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

How do I make both doors go down? i,v problem.

Asked by 8 years ago

Visual example: https://www.youtube.com/watch?v=tS48Fsm7nic

Here's the script for the doors, only one is going down. I want both to go down. Can someone point me in the right direction please?

for i,v in pairs(game.Workspace.LockdownDoors:GetChildren()) do
    local num = 0
    repeat
        v.CFrame = v.CFrame + Vector3.new(0,-0.1,0)
        wait(0.02)
        num = num +1
    until num == 210
end

Thanks!

0
I know this has already been answered but if you're trying to make the door look smooth you might want to look into lerp. (pretty much tweening for parts) NotSoNorm 777 — 8y

1 answer

Log in to vote
0
Answered by
lukeb50 631 Moderation Voter
8 years ago
doors=game.Workspace.LockDownDoors:GetChildren()
times=210

for i=1, times do
 for i=1,#doors do
 doors[i].CFrame = doors[i].CFrame + Vector3.new(0,-0.1,0)
end
wait(0.02)
end

tested

0
Works great, thanks! WelpNathan 307 — 8y
0
np lukeb50 631 — 8y
Ad

Answer this question