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

Why are my scripts erroring out?

Asked by 11 years ago

Hello. I am currently remaking a Gui for a game of mine. For some odd reason, my script seems to error out. Here it is:

01GUI = game.Players.LocalPlayer.PlayerGui
02 
03function OnClicked()
04 
05    for i = 1, 10 do
06    script.Parent.Parent.Visible = false
07    wait(0)
08    GUI.InfoGui.TrackList.Dealership.Visible = true
09 
10    end
11end
12 
13script.Parent.MouseButton1Click:connect(onClicked)

I keep receiving this error:

11:41:39.595 - attempt to call a nil value 11:41:39.596 - Disconnected event because of exception

Here is a link to my a picture of my explorer The highlighted LocalScript is the script I posted above.

If someone could please help me with this, I would greatly appreciate it! Thanks for your time!

1 answer

Log in to vote
3
Answered by 11 years ago

Connection line. The function was called incorrectly, your function was named 'OnClicked', was called as 'onClicked' xD. One little letter.

Ad

Answer this question