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

distant goblet
#

wdym you want it to open into another frame?

#

Like make one visible thats not inside the one you're in?

halcyon reef
#

just make the frame visible??

signal snow
#

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

distant goblet
signal snow
distant goblet
#

right

#

my bad

signal snow
#

k

distant goblet
#

how tis lal layed out

signal snow
distant goblet
#

which frame do you want it to open?

#

and where is the script coming from

signal snow
#

i want "your loadouts" to open a new frame after being clicked

distant goblet
signal snow
#

yes

distant goblet
#

or do you want it to make one for u

signal snow
#

no ill make it myself

#

i just need to know

distant goblet
#

beneath open shop is the frame?

signal snow
#

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

distant goblet
#

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?

signal snow
#

yes

distant goblet
#

alright try

local yourLoadouts = script.Parent
local frameImage = yourLoadouts.Parent

yourLoadouts.MouseButton1Click:Connect(function()
    frameImage.Visible = false
end)```
signal snow
#

where do i put that

distant goblet
#

inside the yourloadouts button

#

as a localscript

signal snow
#

ok

#

it works!

#

but

#

how do i make a frame appear instead

distant goblet
#

just change the frameImage.visible to true

#

if you want it to appear

#

and false if u want it to disappear

signal snow
#

no i mean

#

a diffrent frame

distant goblet
#

just try and define where the frame is

#

where abouts is it

#

ill try and help

signal snow
distant goblet
#

create a variable where the frame is

#

so script.Parent is finding where the script is, and getting the file the script is inside

signal snow
#

are u talking abt the script

distant goblet
#

can u show where the frame is

signal snow
marble mothBOT
#

studio** You are now Level 7! **studio

signal snow
#

i need the button to open into that frame

distant goblet
#

ohhhhh alright

#
local yourLoadouts = script.Parent
local frameImage = yourLoadouts.Parent.Parent.YourLoadouts.Frame

yourLoadouts.MouseButton1Click:Connect(function()
    frameImage.Visible = false
end)```
#

try that

signal snow
#

where do i put that

#

@distant goblet

distant goblet
#

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)

signal snow
#

??

distant goblet
#

add that code

#

instead

signal snow
#

ok

distant goblet
#

cuz the other one is making it invisible when its already invisible

signal snow
#

nope it dont work

distant goblet
#

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

signal snow
distant goblet
#

no you're fine dw

signal snow
#

do i make the frame visible

#

the

#

"your loadouts one"

#

not the texbutton

distant goblet
#

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

signal snow
#

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

distant goblet
#

you're tryna make it visible or invisible?

signal snow
#

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

distant goblet
#

The first frame you told me about?

distant goblet
signal snow
#

oops

#

i think may or may not confused you

#

hold on a second

distant goblet
#

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

signal snow
#

ook i did t

#

wait

#

just making sur

#

you were talking about the YourLoadouts frae

#

frame*

distant goblet
#

yes

signal snow
#

ok'

#

the bottom one

distant goblet
#

then change the button that’s called your loadouts to something like “YourLoadoutsButton”

#

yes

signal snow
#

done

#

now what sir

distant goblet
#

okay do you want the yourloadoutsbutton to make the Frame disappear and YourLoadoutsFrame to appear?

signal snow
#

yes

distant goblet
#

okay right

signal snow
#

@distant goblet

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)

signal snow
#

why is it named "frame1" and not Frame

distant goblet
#

i’m creating variables so it’s easier to go through them

signal snow
#

k

#

same place right

distant goblet
#

yeah

signal snow
#

nope it dosent work

#

does your loadout frame need to be visibe?

distant goblet
#

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

distant goblet
#

if u want it to appear onclick then no

signal snow
#

ok

#

i tested it

#

the loadoutframe is just in the way

#

not invisible

distant goblet
#

okay you want the loadout frame to only be visible when you click the loadoutsbutton

signal snow
#

sorry

#

i mean yes

#

and that means its invisble until i click on it

distant goblet
#

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

signal snow
#

done

#

but its gonna be in the wa

#

way

distant goblet
#

whats gonna be in the way

signal snow
#

nvm

#

but now i click on the button nothing appears

distant goblet
#

im really confused sorry

signal snow
#

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

distant goblet
#

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

signal snow
#

what does "loadoutsbtn" mean

#

@distant goblet

distant goblet
#

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

signal snow
#

what do i name it

#

@distant goblet

distant goblet
#

u dont have to change it

signal snow
#

i should th

#

look at the names

distant goblet
#

yeah but i'm only naming the variables, its not affecting the actual script

signal snow
#

oh ok

#

it works

#

tysm

distant goblet
#

ywwww

signal snow
#

wait

marble mothBOT
#

studio** You are now Level 8! **studio

signal snow
distant goblet
#

if u probs do something similar to the code i gave and tweeked to whatevers easier

#

maybe search up yt tutorials and things, they're helpful