So i was trying to reset every player in my game so i went with a generic loop although it started crashing my game so i just let the loop print the players name if their character existed and it still crashed my game so can anyone give me some insight to why this is happening?
here is the code that crashes the game
function finish() wait(5) for j, k in pairs(game.Players:GetPlayers()) do local c = k.Character if c then print (c) c.Torso:BreakJoints() -- with or without it still crashes wait() end end survivorList = {} infectedList = {} wait(1) serverCheck() end