Well, I think I should do that, although my problem is that it lifts one by one, that is, first it lifts one part and when it finishes, it lifts another. I just want them all to get up at the same time
for i, parts in pairs(script.Parent:GetChildren()) do
if parts:IsA("BasePart") then
parts.Position = parts.Position - Vector3.new(0, 12, 0)
wait(respawn)
for count = 1, 2*600 do
parts.Position = parts.Position + Vector3.new(0, 0.01, 0)
wait(0.001)
end
end
end
Why not coroutine it? Also a small side note, but don’t just keep increasing the Part’s Position every “.001” seconds (wait doesn’t even do that, as the minimum it can go is 0.03 seconds/29 milliseconds), we have TweenService to smoothly transition between these specific properties
local TweenService = game:GetService("TweenService")
local Respawn = 5
for i, part in pairs(script.Parent:GetChildren()) do
if part:IsA("BasePart") then
part.Position -= Vector3.new(0, 12, 0)
coroutine.resume(coroutine.create(function()
wait(Respawn)
local PartTween = TweenService:Create(part, TweenInfo.new(2), {Position = part.Position + Vector3.new(0, 12, 0)})
PartTween:Play()
end))
end
end