Does not change the speed in leaderstats, although in print changes!

Okay, what’s the problem? As you can see I have a script that changes the speed of the player, I tried to make it in leader stats to show his speed, but for some reason, it does not change, and constantly 0. Although the speed itself changes, and if I write print(speed), then I will see that it changes, but if you look in the folder leader stats, you see that it is not. So what is the problem? I need to make the speed change in leader stats as well.



Hey, I just realized you are setting speed, not speed.Value!
Don’t worry it’s a mistake we all make.

2 Likes

Oh, thanks for the help) So I should not write speed = Humanoid.WalkSpeed, but speed.Value = Humanoid.WalkSpeed. Yes?

1 Like

The issues are repeated on lines: 26,31,41

Yes, speed.Value instead of speed. Because speed is an instance specifically a NumberValue, and by doing speed = humanoid.WalkSpeed

You were trying to assign an Instance to an Integer or number.
Speed has the attribute value, and that is what you want to set, not speed.
So that’s why you do speed.Value = humanoid.WalkSpeed instead of speed = humanoid.WalkSpeed

Hope this helps!

Yes, that helped. Thank you so much! You really helped me a lot) THANK YOU!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.