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

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

Asked by
mrldie 0
2 years ago

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)

0
I don't get It, give me some more Information imnotaguest1121 362 — 2y
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. mrldie 0 — 2y
0
try Visible Uppercase letter Puppynniko 1059 — 2y

1 answer

Log in to vote
0
Answered by
is6ak 0
2 years ago
Edited 2 years ago

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.)

Ad

Answer this question