One of them is
for i=0, 1, 0.01 * 100 do model:SetPrimaryPartCFrame(CFrame.new( model.Body.Position:Lerp(CFrame.new(-0.713, 1045.29, -94.712).p, i) )* CFrame.Angles(x,math.rad(0),z)) wait(0) end
The other is
for i = 0, 90 do model:SetPrimaryPartCFrame(model.Body.CFrame * CFrame.Angles(0, 2 * math.rad(i), 0)) wait(0) end
How do I get them to happen at the same time in one script, rather than having one happen before the other?
Use a coroutine:
coroutine.resume(coroutine.create(function() for i=0, 1, 0.01 * 100 do model:SetPrimaryPartCFrame(CFrame.new( model.Body.Position:Lerp(CFrame.new(-0.713, 1045.29, -94.712).p, i) )* CFrame.Angles(x,math.rad(0),z)) wait(0) end end)) coroutine.resume(coroutine.create(function() for i = 0, 90 do model:SetPrimaryPartCFrame(model.Body.CFrame * CFrame.Angles(0, 2 * math.rad(i), 0)) wait(0) end end))
use spawn(fn). Spawn is a ROBLOX-specific function that simplifies coroutines for you. It just takes a function and runs it asynchronously.
spawn(function() for i=0, 1, 0.01 * 100 do model:SetPrimaryPartCFrame(CFrame.new( model.Body.Position:Lerp(CFrame.new(-0.713, 1045.29, -94.712).p, i) )* CFrame.Angles(x,math.rad(0),z)) wait(0) end end) spawn(function() for i = 0, 90 do model:SetPrimaryPartCFrame(model.Body.CFrame * CFrame.Angles(0, 2 * math.rad(i), 0)) wait(0) end end)
Check out the Wiki article for more info.