Scoreboard operations and commands

So I've got the following function:

scoreboard players set @s distance_by_foot 0
scoreboard players operation @s distance_by_foot += @s distance_sneaked
scoreboard players operation @s distance_by_foot += @s distance_walked
scoreboard players operation @s distance_by_foot += @s distance_sprinted

schedule function stolz:milestone_setup/distance_loop 5t```
And someone said to me that `schedule` runs as the server. So the `@s` is probably wrong. Setting every `@s` to `@a` would be a wrong calculation right? How do I resolve this?

I'm not sure about the scoreboard operations in general, so I'd appreciate feedback on that as well.
Continue to help post