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 10 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:

GUI = game.Players.LocalPlayer.PlayerGui

function OnClicked()

    for i = 1, 10 do
    script.Parent.Parent.Visible = false
    wait(0)
    GUI.InfoGui.TrackList.Dealership.Visible = true

    end
end

script.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 10 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