Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

For some reason my walk and Run GUIs won't work in game but they work in Studio?!

Asked by
Vid_eo 126
9 years ago

These 2 scripts won't work in Game but they do in studio? function Die() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 40 end script.Parent.MouseButton1Click:connect(Die)

function Die() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end script.Parent.MouseButton1Click:connect(Die)

0
Please format your code in lua code block. Goulstem 8144 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

Is your script in a LocalScript? I'm noticing your using LocalPlayer. LocalPlayer will only work in a LocalScript. Just put your code in a LocalScript and it should be fine.

0
Thank you! It worked perfectly :D Vid_eo 126 — 9y
Ad

Answer this question