So, i have a for loop. So when i run this for loop it makes my CPU and RAM SKYROCKET and almost crash my PC! Can someone explain why its doing this and maybe a way to fix it? Ty. :)
for i = 25, 0, -1 do -- Timer
killerGui.Text = "Time Left: " .. i
message3.Text = "Time Left: " .. i
wait(1)
local event
event = killer.Character.Humanoid.Died:connect(function()
p = game.Players:GetChildren()
for i = 1,#p do
p[i].Character.Head:remove()
end
print("Killer has died!")
round = ("over1")
wait(1)
event:disconnect()
end)
round = true
end

1 comment
What are the other errors? Also, the other "End" is to end the function it was originally within.