#can someone give me a open and close button script

1 messages · Page 1 of 1 (latest)

midnight summit
#

cuz I'm new to scripting

#

idk how to

little star
#

create text button

#

create frame

#

on click with the text button

#

open the frame

#

btw this is scripting help

frigid marsh
#

local frame = script.Parent:WaitForChild("Frame")
local openButton = script.Parent:WaitForChild("OpenButton")
local closeButton =
frame.Visible = false

openButton.MouseButton1Click:Connect(function()
frame.Visible = true
openButton.Visible = false

closeButton.MouseButton1Click:Connect(function()
frame.Visible = false
openButton.Visible = true
end)

#

For WaitForChild add ur TextButtons name

midnight summit
#

ty

frigid marsh
#

Np

little star
#

that dosent work

bright void
#

we don’t make scripts for you

stark parcel
bright void
#

watch a tutorial on gui buttons

little star
#

wait nvm

#

just use not

#

don’t need to make a close button

frigid marsh
#

In WaitForChild

stark parcel
bright void
#

Button.Activated:Connect(function()
script.Frame.Visible = not script.Frame.Visible
end)

frigid marsh
frigid marsh
stark parcel
frigid marsh
#

Let me copy it and change it

#

local frame = script.Parent:WaitForChild("Frame")
local openButton = script.Parent:WaitForChild("OpenButton")
local closeButton = frame:WaitForChild("CloseButton")

frame.Visible = false

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

closeButton.MouseButton1Click:Connect(function()
frame.Visible = false
openButton.Visible = true
end)

glass bluff
little star
glass bluff
#

Lmafo

little star
#

forgot to include portfolio