I am trying to make a plane model move back and forward. I searched on the internet on how to move a part and found a script that only moves it forward. Here is the code:
local Model = script.Parent
while wait() do Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.new(0,0,0 + -2.5)) end
Now how do i move it in the opposite direction after a few seconds?
local Model = script.Parent while wait() do Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.new(0,0,0 + -2.5)) wait(5) -- wait Model:SetPrimaryPartCFrame(Model:GetPrimaryPartCFrame() * CFrame.new(0,0,0 + 2.5)) --do the same but in opposite direction end
If you wanna make it move in cetrain direction multiple times use for loop.