What should be the way to change the player's walkspeed?

In my script, I want to change the WalkSpeed of the player to 5 when they are within a magnitude and change it back again to 16 when they leave the magnitude - (Heavily simplified version of my script). The script works fine the first time the player enters the area and leaves. However, the second time the player enters the area, although WalkSpeed sets the player’s speed to 5, and printing the humanoid WalkSpeed from the script returns 5(WalkSpeed changed), the player’s walk speed does not actually change and printing humanoid WalkSpeed in the command bar returns the unchanged value of 16. What is happening here and how can I change this?

Also, does this thread have anything to do with this?

I suspect that this is caused by your player leave/enter script. And no that thread which you have mentioned is not directly the cause of the problem, though it might share the same logic.
Mind sharing the code to check where the issue is coming from?

1 Like