Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I don't know why the door is not open when i click?

Asked by 4 years ago
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

0
Lemme try something on your code. Foxy_Developer 111 — 4y
0
I'm making a hole new model. I'll send you the link Foxy_Developer 111 — 4y
0
Thank you. Inw_Original 7 — 4y

Answer this question