xLink123
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
|
| 18 Feb 2015 08:15 PM |
players = {}
game.Players.PlayerAdded:connect(function(player) table.insert(players, #players + 1, player.Name) print(table.concat(players, "")) end)
Is there a more efficient way to create items in a table? Is there a way to print out all the items of a table? I'm sure there is I'm just new to tables and am playing around with the table manipulation wiki article. |
|
|
| Report Abuse |
|
|
xLink123
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Feb 2015 08:18 PM |
local players = game.Players:GetPlayers()
done |
|
|
| Report Abuse |
|
|
| |
|
xLink123
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
|
| 18 Feb 2015 08:21 PM |
| So that creates a table? I can remove players based on if their character dies using table.remove? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 18 Feb 2015 08:22 PM |
| yeah and yeah. what else would it give you :)? |
|
|
| Report Abuse |
|
|
xLink123
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Feb 2015 08:23 PM |
dude...
just call that when you need a table of all the players |
|
|
| Report Abuse |
|
|