I have a local script in StarterPlayerScripts that allows the player to fly. This script has the variable 'speed'. This is how fast the player should fly. I want to have a block that when the player touches it, their speed will increase. So, I used a ModuleScript to store the speed value and have the LocalScript get its speed from the ModuleScript. Unfortunately, when the player touches this block, nothing seems to happen and I figure it's because the value isn't bein updated in the localscript. I also tried putting a while true wait() loop in the local script around where the variables are declared but all that did was stop the script from doing the flying calculations and stuff.
tl;dr How do I edit a value in a LocalScript from anywhere in the game?

1 comment
You would want to use RemoteEvents or a NumberValue to communicate the change of speed to the LocalScript. I would recommend the NumberValue option and checking the changed event as long as the client does not have to check with anything on the server.