Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how can i make an object open/close?

how can i make a door or any other objects to click on them and open or close?

1 answer

That is very simple, here's how to do it.

Step 1: Build your door.

Step 2: Insert a ClickDetector inside your door.

Step 3: Insert a Script inside your door.

Step 4: Copy and paste the following coden into the script

local isDoorOpen = false
local door = script.Parent
local click = door.ClickDetector

click.MouseClick:connect(function()
if isDoorOpen == false then

door.Transparency = 1
door.CanCollide = false

else

door.Transparency = 0
door.CanCollide = true

end



This discussion is preserved as it was. New answers, comments, and votes are closed.