How Do You Update Values With A Script

I’m building a walking/running system using keyboard inputs. Naturally, my system is comprised of functions, but when I change a variable that is declared prior to the function from within the function, the character values don’t change, i.e. character speed. I presume it’s because the values not updating, and I’m not sure how to do that. Is there a method to update the character’s values such as speed? If you need more information, I’d be happy to elaborate.

Do you do something like that?

local WalkSpeed = Humanoid.WalkSpeed
WalkSpeed = 10

you are changing a variable, not a property, you must do it like this

Humanoid.WalkSpeed = 10

If this is not what you do, can you show it?

What an oversight, thanks for the help.

1 Like