I have a table that could have up to three players in it (or as little as one player). I have a :CharacterRemoving event for when the player dies, at the moment I have a :CharacterRemoving even for player1, player2 and player3. The issue with this is if there are only player1 and player2 that actually exist, it calls an error on the player3:CharacterRemoving. Is there a way I could have the :CharacterRemoving event happen if for example
players = {} -- This would have a different amount of players in each time
players:CharacterRemoving:Connect .... blah
--Then this would get called whenever one of the players inside the table dies?
Sorry, I feel like its a bit confusing, it’s hard to explain, let me know if you need any more details, thanks for any help.
No because I only want the character removing event to happen to happen to the players that are inside the arena, I don’t want it to happen to everyone in the server.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterRemoving:Connect(function(character)
if InArena[player.Name] then -- Something like this
-- CODE
end
end)
end)