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

How do I fix this slider?

Asked by
painzx3 43
10 years ago

I'm trying to make double doors and when I click the switch, nothing happens. Please help?


ldoor=script.Parent.Parent.Ldoor rdoor=script.Parent.Parent.Rdoor debounce = true function move() if debouce == true then debounce = false for i=1,14 do ldoor.CFrame=CFrame.new(ldoor.CFrame.x + .5,ldoor.CFrame.y,ldoor.CFrame.z) rdoor.CFrame=CFrame.new(rdoor.CFrame.x - .5,rdoor.CFrame.y,ldoor.CFrame.z) wait() end wait(1.5) for i=1,14 do ldoor.CFrame=CFrame.new(ldoor.CFrame.x - .5,ldoor.CFrame.y,ldoor.CFrame.z) rdoor.CFrame=CFrame.new(rdoor.CFrame.x + .5,rdoor.CFrame.y,rdoor.CFrame.z) wait() end debounce=true end end script.Parent.ClickDetector.MouseClick:connect(move)
0
Is there an error in the output? BlueTaslem 18071 — 10y
0
Suprisingly none. painzx3 43 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

I have no idea why it won't work. I set it all up in Studio and ran it like this

ldoor = script.Parent.Parent.Ldoor
rdoor = script.Parent.Parent.Rdoor
debounce = true

function onClicked()
    if debouce == true then
        debounce = false
        i = 1
        repeat
            i = i+1
            ldoor.CFrame = CFrame.new(ldoor.CFrame.X +1, ldoor.CFrame.Y , ldoor.CFrame.Z)
            rdoor.CFrame = CFrame.new(rdoor.CFrame.X -1, rdoor.CFrame.Y, rdoor.CFrame.Z)
            wait(.01)
        until i == 14
        wait(1.5)
        i = 1
        repeat
            i = i+1
            ldoor.CFrame=CFrame.new(ldoor.CFrame.X -1, ldoor.CFrame.Y, ldoor.CFrame.Z)
            rdoor.CFrame=CFrame.new(rdoor.CFrame.X +1, rdoor.CFrame.Y, rdoor.CFrame.Z)
            wait()
        until i == 14
        debounce=true
    end
end

script.Parent.ClickDetector.MouseClick:connect (onClicked)

Could not get it to work.

0
Something is up with studio or its just my wrongdoing... painzx3 43 — 10y
Ad

Answer this question