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

Why does while true do stop doing anything after some time?

Asked by 3 years ago

While true do works for some time but stops. Here is the code:


local Spawns = {} while true do for i,v in pairs(game.Workspace.Spawns:GetChildren()) do v.Name = v.Name..i table.insert(Spawns,v.Name) end local picked = Spawns[math.random(1,#Spawns)] local spawn1 = game.Workspace.Spawns:FindFirstChild(picked) local zombie = game.ReplicatedStorage.Zombie:Clone() zombie:SetPrimaryPartCFrame(CFrame.new(spawn1.Position+Vector3.new(0,3,0))) zombie.Parent = workspace wait(2) end

1 answer

Log in to vote
0
Answered by 3 years ago

I fixed it with a simple line of code:

settings().Studio.ScriptTimeoutLength = -1

Ad

Answer this question