Lately, I have tried to make to make a GUI. It is located in Startergui. By clicking on a text button, it's text changes. Inside the text button is a script that changes the player's speed depending on what text is present. This is the script itself :
function run()
if script.Parent.Text == "Dash"
then script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 70
script.Parent.Text = "Walk"
elseif script.Parent.Text == "Walk"
then script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 25
script.Parent.Text = "Dash"
end
end
script.Parent.MouseButton1Click:connect(run)
In others words : If the button reads ''Dash'', you gain a walkspeed of 70 If the button reads ''Walk'', you gain a walkspeed of 25. When clicking said button while Play Testing inside the studio, it works like a charm.
However, when inside a game, clicking the button doesn't affect the player's speed!
I've thought that either the click didn't register, or the script didn't work, but it is most likely the latter. It is not a LocalScript, just a regular script. I haven't tried to come up with a solution, due to lack of knowledge. I would be kind if anyone we're to help me fix this script! It's pretty much a key element in my game!

4 comments
When you make your question, put your code in between the Code Block so we can read it.
Fixed.
Thanks! :)
Did you try to putting it in a local script? That's one of the only possible solutions I am thinking of right now. Also, keep in mind that in a game the server-side and client is separated, unlike the solo test. Other then that, your code appears correct.