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

Simple Up and Down Animation Doesn't Work, Any Fix?

Asked by 7 years ago
Edited 7 years ago

I'm super new to this. I made a script that is supposed to make the Part go up and down if _G.Flight is 1, and if not, goes back to the starting position. I have no clue what I'm doing wrong. It doesn't give me an error in the console, it just doesn't work.

rotor = workspace.Interior.Console.Rotor.RotorBottom.Middle
if _G.Flight == 1 then
    for i = 1,16 do
        wait(0.01)
        rotor.CFrame = rotor.CFrame * CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
    end
    for i = 1,16 do
        wait(0.01)
        rotor.CFrame = rotor.CFrame * CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(0, 0, 0)
    end
else
    rotor:SetPrimaryPartCFrame(CFrame.new(9936.876, 60.019, 17.572))
end

Answer this question