Clickable Door

How to make a clickable door, with Pictures.

by Unformity_iiArmi

Author Avatar

Hello I am teaching you how to make a clickable door

Step 1: First you want to make a part.

img|80x45

Step 2: Once you have made the part add a ClickDetector

img|80x45

Step 3: add a script into the part

img|80x45

Step 4: Delete the Print Statement.

print("Hello World!")

Once you have done we need to start scripting

Step 5: Scripting.

local Wood = true

local parent = script.Parent

local function on()
 Wood = true
 parent.Transparency = 0 -- leave this at 0
 parent.CanCollide = true
end

local function off()
 Wood = false
 parent.Transparency = 0.8 -- you can set this to your own 
 parent.CanCollide = false
end

local function OnClicked()
 if Wood == true then off() else on() end

end
parent.ClickDetector.MouseClick:connect(OnClicked)

View in-game to comment, award, and more!