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

[SOLVED] My sentry turret script isn't working as intended?

Asked by
Auxigin 47
4 years ago
Edited 4 years ago

So, I've made a turret from Portal and its panels are supposed to retract after 5 seconds but I can't use wait(5) in a loop, any fixes?

Left = game.Workspace.Left
Left1 = game.Workspace.Left1
Left3 = game.Workspace.Left3
Right = game.Workspace.Right
Right1 = game.Workspace.Right1
Right3 = game.Workspace.Right3
poop = script.Parent.no
wait(1)
script.Parent.Touched:Connect(function(lol)
  for i = 0, 1, 0.01 do
            wait(i/100)
                    Left.CFrame = Left.CFrame:Lerp(Left1.CFrame, i)
                Right.CFrame = Right.CFrame:Lerp(Right1.CFrame, i)
            Left.CFrame = CFrame.new(Left.Position, lol.Position)
        Right.CFrame = CFrame.new(Right.Position, lol.Position)
        end
                -- b is supposed to play after i which b is the retracting lerp
        for b = 0, 1, 0.01 do
        Left.CFrame = Left.CFrame:Lerp(Left3.CFrame, b)
        Right.CFrame = Right.CFrame:Lerp(Right3.CFrame, b)
    end
end)

1 answer

Log in to vote
0
Answered by
Auxigin 47
4 years ago

nvm lmao I was stupid af

0
mood. glad you got it solved. royaltoe 5144 — 4y
Ad

Answer this question