Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why are my scripts erroring out?

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.