Replace a value in a table if nil?

I want to draw a list of friends from the server on my screen.

I’ll be adding them to a table, but I’m unsure how I could move a player up a slot if a friend disconnects.
I’ve done this before with tons of if statements. Is there a better way?

Tracking players is important; here’s a way you can do that ( you can even keep the data when they disconnect which would be useful for administration ).

Additionally, for players, instead of storing as a numbered auto-incrementing table.insert index, store them in a way that makes them easily findable.

https://dl.dropboxusercontent.com/u/26074909/tutoring/tracking_players/player_connect_and_disconnect.lua

https://dl.dropboxusercontent.com/u/26074909/tutoring/tracking_players/player_connect_and_disconnect_with_list_example.lua

These are good to read, thanks.

I didn’t know you could do things like this,


 local _name = _data.name; 

I’ll continue reading this later.