#Can someone help me?i made a textbutton and when i click on it i want it to open into another frame
180 messages · Page 1 of 1 (latest)
just make the frame visible??
Sorry for not responding but i have the frame and the textbutton. If i click on the button it will make the frame invisible and make the new frame visible
can u show ur explorer structure
?
k
how tis lal layed out
i want "your loadouts" to open a new frame after being clicked
is the new frame visible in this picture?
yes
or do you want it to make one for u
beneath open shop is the frame?
hold on let me explain
so theres a part that makes the frame visible if you interact with it
i made a close button and everythig
but i now i want the button to be click
clicked*
then the current frame goes invisible and the new frame I made goes visible
so let me try and get this right. You want the frame thats below openshop script to go invisible when your loadouts has been clicked?
yes
if i explained it wrong sorry
alright try
local yourLoadouts = script.Parent
local frameImage = yourLoadouts.Parent
yourLoadouts.MouseButton1Click:Connect(function()
frameImage.Visible = false
end)```
where do i put that
just change the frameImage.visible to true
if you want it to appear
and false if u want it to disappear
wdym
create a variable where the frame is
so script.Parent is finding where the script is, and getting the file the script is inside
are u talking abt the script
can u show where the frame is
** You are now Level 7! **
i need the button to open into that frame
ohhhhh alright
local yourLoadouts = script.Parent
local frameImage = yourLoadouts.Parent.Parent.YourLoadouts.Frame
yourLoadouts.MouseButton1Click:Connect(function()
frameImage.Visible = false
end)```
try that
same place, just replace the code that i just gace u
gave
oh
wait
local yourLoadouts = script.Parent
local frameImage = yourLoadouts.Parent.Parent.YourLoadouts.Frame
yourLoadouts.MouseButton1Click:Connect(function()
frameImage.Visible = true
end)
??
ok
cuz the other one is making it invisible when its already invisible
nope it dont work
alright
my bad
okay
is ee
i was being dumb
local yourLoadouts = script.Parent
local frameImage = game:GetService("ScreenGUI").YourLoadouts.Frame
yourLoadouts.MouseButton1Click:Connect(function()
frameImage.Visible = true
end)
try that
i think im the one being dumb
no you're fine dw
if you want the frame to appear, then the script will make it visible if it isnt visible already
so you have to keep the visibility off when you load in, and the script will detect the click and make it visible again
it dosent work 😭
i made the frame invisible but when i click on the button nothing appears
i think your first script worked better
@distant goblet
you're tryna make it visible or invisible?
its gonna be invisible until i click on the button which makes the other frame that the button is currently in invisible and the frame i just made "Your Loadouts" visible
i also renamed Frame to YourLoadouts
The first frame you told me about?
the one here thats called frame
alright maybe change the name of the frame to “YourLoadoutsFrame” so it doesn’t get confusing further on
and also with the text button that’s called your loadouts, try and not put spaces between the names of th and just put yourloadoutsbutton
then when you’ve done that
ook i did t
wait
just making sur
you were talking about the YourLoadouts frae
frame*
yes
then change the button that’s called your loadouts to something like “YourLoadoutsButton”
yes
okay do you want the yourloadoutsbutton to make the Frame disappear and YourLoadoutsFrame to appear?
yes
okay right
@distant goblet
local yourLoadouts = script.Parent
local frame1 = yourLoadouts.Parent
local LoadoutFrame = frame1.Parent.YourLoadouts.YourLoadoutsFrame
yourLoadouts.MouseButton1Click:Connect(function()
frame1.Visible = false
LoadoutFrame.visible = true
end)
why is it named "frame1" and not Frame
i’m creating variables so it’s easier to go through them
yeah
local yourLoadouts = script.Parent
local frame = script.Parent.Parent
local YourFrameLoadouts = frame.Parent.YourLoadouts.YourLoadoutsFrame
yourLoadouts.MouseButton1Click:Connect(function()
frame.Visible = false
YourFrameLoadouts.Visible = true
end)
maybe try that
the bottom one no
if u want it to appear onclick then no
okay you want the loadout frame to only be visible when you click the loadoutsbutton
okay then make the loadoutsframe not visible before u load in
so just go to it and go to properties
scroll down and look for visible
uncheck the checkbox
whats gonna be in the way
im really confused sorry
ok
so
i have a shop gui
i need the textbutton
to make the frame that they are currently in
invisible
and make the Yourloadouts frame visible
something similar to your first frame
local loadoutsbtn = script.Parent
local frame = script.Parent.Parent.Parent.Frame
local YourLoadoutsFrame = script.Parent.Parent.Parent.Parent.YourLoadouts.YourLoadoutsFrame
loadoutsbtn.MouseButton1Click:Connect(function()
frame.Visible = false
YourLoadoutsFrame.Visible = true
end)
if it doesnt work it might because of spelling errors or i just havent got the name of your properties right
i made a variable
local creates a variable which is something that holds data in
basically a shortcut
and i just named it that to make it easier for me
u dont have to change it
yeah but i'm only naming the variables, its not affecting the actual script
ywwww
wait
** You are now Level 8! **
is there a way to make it do the same thing but on another frame?