Title freezes just like a while true do loop
Server Script
while wait(5) do
if game.Lighting.ClockTime >= 18 or game.Lighting.ClockTime <= 7 then
local zombies = game.ServerStorage.Zombies:GetChildren()
while math.random(1,3) do
for i = 1 , #zombies do
if i == math.random(1,#zombies) then
local c = zombies[i]:Clone()
c.HumanoidRootPart.CFrame = CFrame.new(math.random(-50,50), 5 ,math.random(-50,50))
end
end
end
end
end
output:
13:13:16.468 - Game script timeout
13:13:16.470 - Stack Begin
13:13:16.470 - Script 'ServerScriptService.ZombieSpawnScript', Line 5
13:13:16.471 - Stack End

1 comment
You have no yields in your second while loop and so it hangs the main thread. Put a yield of some sort such as
wait()in your second while loop. (your second while loop is the one with "while math.random(1, 3) do")