0

# How to Make a TextButton open a frame with a different parent?

Ive tried using the regular code for opening a frame but it does not work, can you assist me in how i could do this?

0
Edited 14 days ago
local frame = script.Parent.Parent.Test -- change “Test” to the name of the frame
local open = false

script.Parent.MouseButton1Click:Connect(function()
if frame.Visible == false then       --change "frame" with the name of yours
frame.Visible = true     --change "frame" with the name of yours
end
end)



Put this in a local script hope i helped if i did please mark this as solve :)

[FIXED]

0
It says the script has no errors but when I test it it does not open the script with a different parent? Guest_99866 7 — 14d
-1
Edited 14 days ago

Try this:

local frameToOpen = game.StarterGui.OtherFolder.Frame1 -- change this to your frame that you want to enable

local textLabel = game.StarterGui.OtherOtherFolder.Frame2 --this should be the textlabel

frameToOpen.Visible = true
textLabel.Visible = true

end


All this does is takes an event and checks if its true, then enables the frame GUI. There are other ways to enable, but this is not a descriptive thread.

0
Im confused, by "if statement" do you mean if frameToOpen.Visible == false then frameToOpen.Visible = true? and what would I change that to, the entire line or just a part of it? Guest_99866 7 — 14d
0
I mean that if you have a certain event you want, not just if frameToOpen.Visible == true, you could do any event you want, even if it was like if game.Workspace.Part.Transparency == 1 then, enable the GUI blah blah blah. fiddyfiddler 18 — 14d
0
This doesn't work, as the GUI viewed by the player is not currently in StarterGui. DeceptiveCaster 3761 — 14d
0
The local GUI should be in starter-gui. fiddyfiddler 18 — 14d