I have done this before, but i cannot figure out why it isn't working. the game im putting it in is FE, so that may be why. or i might be doing it differently from before, since it's been a while since i have done this,
the script doesnt remove player's UserId's from the table when they leave and it just keep them there,
it's a global player list, so i cant just get from players in the servers.
function playerAdded(player) online:UpdateAsync("onlinep", function(old) onlineplayers = old or {} table.insert(onlineplayers, player.Name) return onlineplayers end) end function playerLeft(playerl) for i,v in pairs(onlineplayers) do if v == playerl.Name then table.remove(onlineplayers, i) return onlineplayers end end end game.Players.PlayerAdded:Connect(playerAdded) game.Players.PlayerRemoving:Connect(playerLeft)
it's been a while since i have done this and i can't find anything that works on the wiki, but it never worked.