Alright, so all I am trying to do is make a person's WalkSpeed 0 when they click on an ImageButton. The rest of the script is to make their WalkSpeed 16 again once my "countdown" reaches 0. If I need to explain anything with my "countdown" then I can, though I do not think the problem lies with the countdown. When I run the script, the output tells me, 11:11:21.331 - Players.Player.PlayerGui.PumpkinCarver.MainFrame.PC - Pumpkin Carver.OnClick:3: '=' expected near ''
function onClick() script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 0 local NumberValue = script.Parent.Parent.Parent.ImageLabel.TimeLeft.Value if NumberValue.Value == 0 then script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16 end end script.Parent.MouseButton1Click:connect(onClick)
Any thoughts? Thank you. :)
Line 6 only checks to see if the NumberValue.value is 0 once. You'd need a loop there.
while numberValue.Value ~= 0 do wait() end --set walkspeed
For every about half second that the value is not 0, the loop will check again. Also, make sure all of your variables are right.