Ad
Log in to vote
0

Why can't I interact with buttons outside a frame? (screenshot included)

Asked by 14 days ago
Edited 14 days ago
invis = -- i can't find the button i want to make invisible
script.Parent.MouseButton1Click:connect(function()
    invis.Visible = false
end)

https://imgur.com/a/2Le7x8d

1 answer

Log in to vote
1
Answered by
SuperPuiu 482 Moderation Voter
14 days ago
Edited 14 days ago

Hello!

The instance looks like it's a child of Frame isn't it?

invis = script.Parent.Parent["Enter here the name of the button"] -- replace the text that's in "" with the button name
script.Parent.MouseButton1Click:connect(function()
    invis.Visible = false
end)

If it is a child of StarterGui then:

invis = script.Parent.Parent.Parent["Enter here the name of the button"] -- replace the text that's in "" with the button name
script.Parent.MouseButton1Click:connect(function()
    invis.Visible = false
end)

See what I did? I 'jumped' from parent to parent to the Parent where the button is.

Ad

Answer this question