This is how you iterate over player characters, and makes it 100% bulletproof to any error.
for _, player in game.Players:GetPlayers() do
local character = player.Character
if not character then continue end
-- Do something to their character.
end