I am new to scripting and I am teaching myself which is going smoothly except the output is saying I need a nil value to fix my script
local play = script.Parent local Frame = game.StarterGui.Check.Frame local Click = play.MouseButton1Click:connect(onClick) local Check = game.StarterGui.Check Check.Frame.Visible = true function onClick(play) Check.Frame.Visible = nil end
the output says attempt to call a nil value
I even tried making the script:
local play = script.Parent local Frame = game.StarterGui.Check.Frame local Click = play.MouseButton1Click:connect(onClick) local Check = game.StarterGui.Check Check.Frame.Visible = true function onClick(play) Check.Frame.Visible = nil if nil == true then Check.Frame.Visible = false end end
Please help!
It's not recommending that you try to call a nil value, it's letting you know that you've already tried.
The problem is that onClick
does not exist until line 8 (using your first script), but you attempt to use it on line 3. Line 3 should be after you have defined the function.
In the future, also include what line the error is occurring on, or let us know if there isn't one.