|
| 05 Apr 2014 09:47 AM |
for i,v in pairs(game.Players:GetChildren()) do table.insert(Tbl_Players, v) end
so basically, after it does that, and I print table I get - Player1 Player2 Player1 Player2
and there is only 2 players in the game, no duplicates. This is the only thing that adds players to the table so what can I do? |
|
|
| Report Abuse |
|
|
uyoyalt
|
  |
| Joined: 16 Apr 2013 |
| Total Posts: 2860 |
|
|
| 05 Apr 2014 09:51 AM |
I got that too, but I think mine is not a loop Double printed. |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 09:54 AM |
| I continue elsewhere to make values for each player in Tbl_Players and it makes two values for each player meaning that it probably wasn't double printed but actually made two for each. |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 09:56 AM |
It runs through each player, but does what you want twice. I'd add a break after you do the table.insert.
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 10:04 AM |
| I got it to work somehow, I am not really sure how. Anyway, thanks for the tips and ideas. |
|
|
| Report Abuse |
|
|
Ictis
|
  |
| Joined: 01 Sep 2011 |
| Total Posts: 1216 |
|
|
| 05 Apr 2014 10:24 AM |
| My guess is you set it to run once for every player in the game. Two players = two outputs of the same data. |
|
|
| Report Abuse |
|
|
|
| 05 Apr 2014 10:38 AM |
for i,v in ipairs(game.Players:GetPlayers()) do table.insert(Tbl_Players, v) end
If that don't work, try;
do for i,v in ipairs(game.Players:GetPlayers()) do table.insert(Tbl_Players, v) end end
Although I don't think the second one would help |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 05 Apr 2014 10:41 AM |
| @warp, why is that do there? no point |
|
|
| Report Abuse |
|
|
| |
|