So i have this script, which starts an infinite loop when a player joins, where it adds current player's location to list every tick. When the list hits some size, it deletes the first saved location. That way list should have a fixed size and sort of like shift (as example: [1,2,3,4] -> [2,3,4,5] -> [3,4,5,6] ...]).
The point is to store last 3 seconds (60 ticks) of player's movement. But when I test it, the list of locations stays always the same as 3 seconds after player joined and doesn't update.
I tried different variations of this algorithm, but nothing seems to work. What am I doing wrong here?
The point is to store last 3 seconds (60 ticks) of player's movement. But when I test it, the list of locations stays always the same as 3 seconds after player joined and doesn't update.
I tried different variations of this algorithm, but nothing seems to work. What am I doing wrong here?
Code:
on join:
set {s%player%} to true
while {s%player%} is true:
add location of the player to {locs%player%::*}
if size of {locs%player%::*} is 61:
delete {locs%player%::1}
wait 1 tick