This is a regular script thats disabled and gets enabled by another script thats also not a local script. I want it to just kill everyone on the server ONCE, but for some reason it either kills a few people on the server and when it does theyre trapped in an infinite loop of being killed even after I put break and disable the script afterwards.
for i, player in pairs(game.Players:GetChildren()) do player.Character.Humanoid.Health = 0 break end
The loop automatically breaks once it finishes going through all the players, so the break isn’t necessary.
I can’t find anything in the script that loops the loop though. Is this the whole script? If not, check if this is in a while true do loop or repeat.
Oh, and disabling the script doesn’t completely disable everything running in the script. If you have any loops running in the script and disable the script, the loop will still continue until it breaks. It shouldn’t run any more code after that though.
Putting a break inside the loop will end the loop altogether, so it will only end up killing one person. Also, you need to check if their character exists.
for i,v in pairs(game.Players:GetPlayers())do if v and v.Character then v.Character:BreakJoints() end end