Can you do this with module scripts too?
If you’re making a round based game, you could do this when you’re inserting the players into a table:
for _, player in pairs(players) do
local tableIndex = #playersInGame + 1
table.insert(playersInGame, player)
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
table.remove(playersInGame, tableIndex)
end)
end