I'm trying to make a clickable door, and I've made it so it's rotated open with this script:
game.Workspace.Door.Script.Name = "Clickable Door Script" script.Parent.ClickDetector.MouseClick:connect(function() game.Workspace.Door.Rotation = Vector3.new(0,3,0) end)
I want to make it able to close if you click it again.
You would use a simple variable to check if it has been opened or not.
local open = false; script.Name = "Clickable Door Script"; -- On the assumption that this is that script script.Parent.ClickDetector.MouseClick:connect(function() if not open then -- Checks if closed script.Parent.Rotation = Vector3.new(0, 3, 0); open = true; else -- If open script.Parent.Rotation = Vector3.new(0, 0, 0); open = false; end end)