So whenever i click on the button to open the frame, it opens it but when i click it again it doesn't close, it opens on the first click but doesn't close on second click. I'm a very big noob at scripting and mostly use roblox scripting tutorials. In the code, "stuff" is the frame that needs to close. Here's the code
player = game.Players.LocalPlayer
human = game.Players.LocalPlayer.Character
local b = require(script.RankScript)
Open = false
function MouseClick()
if Open == false and human.Torso.roblox.Texture == b.Owner or player.userId == 75955576 then
Open = true
script.Parent.Parent.Parent.Stuff.Visible = true
elseif Open == true then
Open = false
script.Parent.Parent.Parent.Stuff.Visible = false
end
end
script.Parent.MouseButton1Down:connect(MouseClick)

1 comment
:connect is depreciated. use :Connect