I don't know why the door is not open when i click?
local Can = true
local Open = false
Button = script.Parent
function Click()
if Can then
Can = false
if Open == false then
local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
for i = 0,1,.1 do
local cfm = script.Parent.Parent.PrimaryPart.CFrame:lerp(finish,i)
script.Parent:SetPrimaryPartCFrame(cfm)
wait()
end
end
Open = true
else
Open = false
local finish = script.Parent.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
for i = 0,1,.1 do
local cfm = script.Parent.Parent.PrimaryPart.CFrame:Lerp(finish,i)
script.Parent:SetPrimaryPartCFrame(cfm)
wait()
end
end
Can = true
end