Ad
Log in to vote
0

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

Asked by 14 days ago

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?

2 answers

Log in to vote
0
Answered by 14 days ago
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
Ad
Log in to vote
-1
Answered by 14 days ago
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

if game.Workspace.DeleteTextLabel.AddedAttribute1 == true then --change this to your event or your if statement
    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.

[MARK ME ANSWERED IF I ANSWERED CORRECTLY!!!]

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
View all comments (2 more)
0
I also don't think this is a hard topic to understand. Why don't you watch TheDevKing's Scripting and GUI Tutorials: (Scripting) https://www.youtube.com/watch?v=BkYwRdCukZA&list=PLhieaQmOk7nIfMZ1UmvKGPrwuwQVwAvFa (GUI) https://www.youtube.com/watch?v=4yeeGnEBzFY&list=PLhieaQmOk7nK9ob348Yc_PTcIyHjDCnem fiddyfiddler 18 — 14d
0
(@Guest_99866) fiddyfiddler 18 — 14d

Answer this question