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.

4 comments
I would imagine that the problem lies with when you add their ID in, not when you remove it. Could we see that code?
it works because i get the player's name from the ID to put on the gui. but okay
i just changed it to player's names though because it's not saving data
Use this instead http://wiki.roblox.com/index.php?title=API:Class/Players/GetUserIdFromNameAsync, no datastore needed!