So when a player leaves it breaks the round script. My game is round based and is based on who survives the longest but when a player leaves it breaks the game and makes them win. I know the issue is its not counting the player as removed when they leave so I cant figure out how to remove them once the player leaves heres my script
game:GetService('Players').PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character:WaitForChild('Humanoid').Died:connect(function()
local Update = {}
for i, v in ipairs(_G.gameplayers) do
if v ~= player.Name then
table.insert(Update,1,v)
end
_G.gameplayers = Update
end
end)
end)
end)

2 comments
Didn't work.
Then that code is not the origin of the issue, it must be in your other code that declares the winners