Hello I am teaching you how to make a clickable door
Step 1: First you want to make a part.
Step 2: Once you have made the part add a ClickDetector
Step 3: add a script into the part
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)