Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How would I insert ONE playyer into a table?

Asked by 10 years ago

Hi! I was wonder how I would insert ONE, just ONE, player into a table after he/she has been randomly picked (I already have that coding written.)

2 answers

Log in to vote
1
Answered by
Discern 1007 Moderation Voter
10 years ago
table.insert(TABLENAME, PLAYER'SNAME]
0
I mean, how would it insert the player into the table after he/she was randomly picked. stanford7787 0 — 10y
0
This is exactly what you want. adark 5487 — 10y
0
You changed it. :I stanford7787 0 — 10y
0
He couldn't have. It doesn't say "Edited x time ago" PiggyJingles 358 — 10y
0
That is not what it said earlier yesterday. stanford7787 0 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
local player = math.random(1, game.Players.NumPlayers);
local playerList = {};
table.insert(playerList, game.Players[player]);
0
This is helpful, but I just want to insert one player into a table, I already have a random player chooser script. stanford7787 0 — 10y
0
This... only inserts one player? PiggyJingles 358 — 10y
0
No, but you added the random player chooser, but I already got an answer, thanks though. stanford7787 0 — 10y

Answer this question