iHypered
|
  |
| Joined: 09 Nov 2010 |
| Total Posts: 2751 |
|
|
| 23 Aug 2017 02:45 PM |
this should insert names of players, it doesnt do it. this is in the middle of a game script:
playersalive = {} for i, v in pairs (game.Players:GetPlayers()) do if v then table.insert(playersalive, v.Name) end end
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 23 Aug 2017 02:47 PM |
playersalive = game.Players:GetPlayers()
maybe you have to specify the pos to insert it at
|
|
|
| Report Abuse |
|
|
iHypered
|
  |
| Joined: 09 Nov 2010 |
| Total Posts: 2751 |
|
|
| 23 Aug 2017 02:51 PM |
wait so basicly, i can just make the table by saying that it equals game.Players:GetPlayers() because that is already a table, and it would be what im trying to do??
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
| |
|
iHypered
|
  |
| Joined: 09 Nov 2010 |
| Total Posts: 2751 |
|
|
| 23 Aug 2017 03:05 PM |
i printed the table when i shouldve been in it, and it said it was nil
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
| |
|
iHypered
|
  |
| Joined: 09 Nov 2010 |
| Total Posts: 2751 |
|
|
| 23 Aug 2017 03:26 PM |
oh, i figured it out, this part wasnt the problem, it did create a table, i just wasnt printing it right. it turns out the problem is somewhere in this:
if # playersalive == 1 then game.Workspace.ServerText.Value = v.Name.." is the Winner" end
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 23 Aug 2017 03:26 PM |
you're prob trying to index by string or something
ohhh you were trying to make a dictionary werent u
|
|
|
| Report Abuse |
|
|
iHypered
|
  |
| Joined: 09 Nov 2010 |
| Total Posts: 2751 |
|
|
| 23 Aug 2017 03:30 PM |
no, just make a table of players (which turned out to work) and then just get the name of the player that won, then show it on the server. there is already a script that makes it so that players are removed from the table when they die too
|
|
|
| Report Abuse |
|
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 23 Aug 2017 03:39 PM |
ugh i hate this floodcheck i get ninja'd every time
ok
|
|
|
| Report Abuse |
|
|