Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

tributes = {}

1 comment

0

ive been trying to work it out but i just dont know how to do it. Could you give me an example?

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.