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

attempt to index nil with 'visible' how to fix?

Its a simple script, I'm a beginner. So forgive me for my ignorance. I just want this to work lol

script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent:WaitForChild("Frame").visible = true end)

3 comments

0

I don't get It, give me some more Information

0

My computer glitched apologies for the previous comment. I want a settings option, and the frame is invisible until you click on settings. But when you do click on settings the error " attempt to index nil with 'visible' " is the error.

0

try Visible Uppercase letter

1 answer

Attempt to index nil with 'visible' means it can't find the property visible on the instance.

This is probably cause it can't find the Frame you're refering to in

script.Parent.Parent:WaitForChild("Frame")

Try to make a variable beforehand, like this;

local Frame = script.Parent.Parent:WaitForChild("Frame")

(Also, not sure if you know but you used parent twice.)

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