Hello guys!!! Heres our first tutorial!!!
LocalScript
(Put this LocalScript inside a button called Open and change the FramesNames To Your Own Frame)
-----------------------------------------------------
-[[ VARIABLES ]]-
local extra = script.Parent.Parent.Parent.OpenFrame.Open -- These are called variables (this is how it detects the items basically i think)
-[[ OPEN/CLOSE SCRIPT ]]-
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.TutFrame.Visible = not script.Parent.Parent.Parent.TutFrame.Visible -- this is saying that if the frame is not visible then make it visible if you press the button.
if not script.Parent.Parent.Parent.TutFrame.Visible then -- if the frame is not visible then make it visible, change text to "Open" change color to "Green" and a cooldown of however long u want it
extra.Text = "Open"
extra.TextColor3 = Color3.new(0.333333, 1, 0) -- this is what the color turns into when pressing the button (open for green)
wait(1)-- change num to how long u want it to be
elseif script.Parent.Parent.Parent.TutFrame.Visible then -- if the frame is not visible then make it visible, change text to "Close" change color to "Red" and a cooldown of however long u want it
extra.Text = "Close"
extra.TextColor3 = Color3.new(1, 0, 0) -- this is what the color turns into when pressing the button (open for red)
wait(1) -- change num to how long u want it to be
end
end)
-[[ TEXT MESSAGES ]]-
-- (this is how im talking to you)
-- Change TutFrame to whatever your frame is called.
-- More advanced feature.
-- Even more advanced? Gotcha.
-- Want a cooldown on the button? Lets do it.
-- This is how you organize
-- Thats how you make a working Open/Close button!
-- Next tutorial on how to make a morph button with animations, sounds, gui (creates for yourself), working stun/jumpscare system!
-- Bye!