$execute as @e[tag=treadmill,tag=id$(id)] at @s rotated 90 0 align xyz run function ws:misc/gym/treadmillspeed {id:$(id)}
$execute as @e[tag=treadmill.timer,tag=id$(id)] if score @s treadmill.timer matches 0 as @a[tag=treadmill.active$(id)] run function ws:misc/gym/treadmillreward {id:$(id)}  
$execute as @e[tag=treadmill,tag=id$(id)] at @s align xyz unless entity @a[tag=treadmill.active$(id),dx=0] run function ws:misc/gym/treadmilldeactivate {id:$(id)}