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

How do i insert 24 random players in a single table?

Asked by 10 years ago

How do i insert 24 random players in a single table? Make the table like this

tributes = {}

0
ive been trying to work it out but i just dont know how to do it. Could you give me an example? shadowsonichedgehogx -2 — 10y

1 answer

Log in to vote
1
Answered by
Muoshuu 580 Moderation Voter
10 years ago
local Players=game.Players:GetChildren()
local Tributes={}
for i=1,24 do
    local Num=math.random(1,#Players)
    local P=Players[Num]
    if P then
        table.insert(Tributes,P)
        table.remove(Players,Num)
    end
end
Ad

Answer this question