Making a button close the current frame that is opened

Congratulations man!
I didn’t really get what you were saying so please forgive me, I wasn’t able to help a lot

1 Like

Its ok. But thanks for trying :slight_smile:

No problem!
I though you meant that when you click the button, it disables all the guis in the screen so there will be no visible gui.
My bad sorry

Well everyone. Thanks. About 60 comments to resolve this. I guess I can continue working on my game.

I added you, if you need any help just message me in here or on Roblox and I’m happy to help!

Ok! Thank you! I will accept you!

No problem! Ok! See you around!

Well, i made a Basic Script for You and i Hope it will be Help you out

image
The Core Script:

local Button1 = script.Parent.Button1

local Button2 = script.Parent.Button2

local Button3 = script.Parent.Button3

local Shop = script.Parent.Shop

local Inv = script.Parent.Inv

local Info = script.Parent.Info

Button1.MouseButton1Click:Connect(function()
	Inv.Visible = true
	Shop.Visible = false
	Info.Visible = false
end)

Button3.MouseButton1Click:Connect(function()
Inv.Visible = false
Shop.Visible = true
Info.Visible = false
end)

Button2.MouseButton1Click:Connect(function()
Inv.Visible = false
Shop.Visible = false
Info.Visible = true
end)

its Very Basic

and The Close Script :
image

local CloseB = script.Parent

local frame = script.Parent.Parent 

CloseB.MouseButton1Click:Connect(function()
frame.Visible = false
end)

thats it :smiley:

3 Likes

Thanks but I already fixed it. But thanks for helping out!

1 Like

:smiley: No Problem bro if You need any help We are here to help you

Thanks! I appreciate it a lot!

1 Like

The only difference in my script is that my script will work always and your - not really. You will have to add some values for to make it work.

1 Like

I just made one myself…
Place this localscript inside the textbutton of badgelistgui since were going to set the frame visible to true
for i,v in pairs(to where u place the gui:GetChildren()) do
if v.Name == ‘BadgeListGui’ then
v.Frame.Visible = true
elseif v.Name == ‘GamepassGui’ then
v.Frame.Visible = false
elseif v.Name == ‘MenuGui’ then
v.Frame.Visible = false
end
end
end)

next is menugui just change the visible of menugui to true and the badgelist to false