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

Why isn't my Gui button working?

Asked by
Seraine 103
10 years ago

The button should be removed when it's clicked, and sets the player's walkspeed to 16.. At the moment it does nothing :/

Button = script.Parent -- close button
Button2 = script.Parent.Parent.Parent -- removes the gui

function onClick()
    script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Walkspeed = 16 -- sets player's walkspeed to 16
    Button2:Destroy() 


end 

Button.MouseButton1Click:connect(onClick) 

The script is inside an image button, inside a frame, inside a Gui which is inside StarterGui

1 answer

Log in to vote
1
Answered by
Discern 1007 Moderation Voter
10 years ago

Change Walkspeed to WalkSpeed.

0
Thank you! :) Seraine 103 — 10y
0
In studio in the 'View' Tab, open the 'Output' window. This will (most of the time) find errors in syntax or stuff like that SpazzMan502 133 — 10y
Ad

Answer this question