|
| 02 Nov 2014 07:01 PM |
This script likes to choose 1 person as 2 "roles" Is there a more efficent way of doing this?
local Players = game.Players:GetChildren() local King = Players[math.random(1, #Players)] local Guard1 = Players[math.random(1, #Players)] local Guard2 = Players[math.random(1, #Players)] local Assassain = Players[math.random(1, #Players)] repeat local King = Players[math.random(1, #Players)] local Guard1 = Players[math.random(1, #Players)] local Guard2 = Players[math.random(1, #Players)] local Assassain = Players[math.random(1, #Players)] until Assassain.Name ~= Guard1.Name and Guard1.Name ~= Guard2.Name and King.Name ~= Guard1.Name and Guard2.Name ~= King.Name and Assassain.Name ~= King.Name print(King.Name.." "..Guard1.Name.." "..Guard2.Name.." "..Assassain.Name.."") |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Nov 2014 10:14 PM |
while wait() do bump(Reply.Parent) end
|
|
|
| Report Abuse |
|
|
|
| 02 Nov 2014 10:42 PM |
Function Bwamp() while wait() do Bump(Reply.Parent) end end
while wait() do Bump(Reply.Parent) Spawn(Bwamp) end |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 07:35 AM |
t = Reply.Parent.Replies repeat wait() Bump(Reply.Parent) until Reply.Parent.Replies == t + 1 |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 07:46 AM |
| Yes actually, you need to start with a table of players, and then remove them from that table placing them into a "role" table and having leftover the non-role type players in the original table so as not to assign multiple roles to one player. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Nov 2014 08:39 AM |
Players=game.Players:getChildren()
king=Players[1,#Players]
table.remove(Players, king)
and so on like that, is the idea. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2014 08:40 AM |
| Oh, I get what your getting at. Thanks! |
|
|
| Report Abuse |
|
|
| |
|