|
| 16 Dec 2013 09:47 PM |
| I'd like a script that picks a random player from the game, then gives them [weapon1]. Then gives all the other players [weapon2]. I've been trying to code this for two days, and I'm getting nowhere. Help is appreciated. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2013 09:48 PM |
| Your attempt at the script is required for my help or many of the others on this forum. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2013 10:07 PM |
playing = {} assassin = {} p = game.Players:GetPlayers() for i=1,#p do if p[i].Character ~= nil then if p[i].Character:findFirstChild("Spectate") == nil then table.insert(playing, p[i]) end end end num = math.random(1,#playing) assassin = playing[num] wait() wep = game.Lighting.Assassin wep:Clone().Parent = assassin.Backpack end for i=1,#p do if p[i].Character ~= nil then if p[i].Character:findFirstChild("Spectate") == nil and p[i].Name ~= assassin.Name then wep = game.Lighting.Officer wep:Clone().Parent = p[i].Backpack end end |
|
|
| Report Abuse |
|
|
|
| 17 Dec 2013 12:27 AM |
i would do like this:
players = { 1, 2, 3, 4, 5, 6, }
chosen=math.random(1,#players) players[chosen]=assassin --stuff that gives assassin his stuff
for i,v in ipairs(players) if players[i] ~= assassin then -- give player weapon end
|
|
|
| Report Abuse |
|
|
| |
|