Yes, I do that with the module.
function moduleFunction.AddPlayer(player)
if player:IsA("Player") then
if playerInfo.AFK == false then
playerInfo.InRound = true
print(player)
table.insert(moduleFunction.playersInRound, player)
connections[player.Name] = player.Character.Humanoid.Died:Connect(function()
table.remove(moduleFunction.playersInRound, table.find(moduleFunction.playersInRound, player))
end)
elseif playerInfo.AFK == true then
warn("Player is afk. Was not added to the list")
playerInfo.InRound = false
end
end
end
function moduleFunction.RemovePlayer()
-- Kill the players
for _, connection in pairs(connections) do
connection:Disconnect()
wait()
end
for _, player in pairs(moduleFunction.playersInRound)do
player:LoadCharacter()
wait()
end
playerInfo.InRound = false
moduleFunction.playersInRound = {}
end