|
| 22 Sep 2015 05:17 PM |
players=game.Players:GetPlayers() local pshooter=players[math.random(1,#players)] if players.NumPlayers > 0 and players.NumPlayers < 7 then pshooter = 1 elseif players.NumPlayers > 6 and players.NumPlayers < 12 then pshooter = 2 elseif players.NumPlayers > 11 and players.NumPlayers < 16 then pshooter = 3 elseif players.NumPlayers > 15 and players.NumPlayers < 26 then pshooter = 4 elseif players.NumPlayers > 25 then pshooter = 5 end
I think it has something to do with math.random? |
|
|
| Report Abuse |
|
|
|
| 22 Sep 2015 05:30 PM |
You're trying to call NumPlayer on an array. You call it on game.Players.
|
|
|
| Report Abuse |
|
|
|
| 23 Sep 2015 05:46 PM |
| so rocket what would I switch it with? |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2015 05:47 PM |
#code players=game.Players local x = players:GetChildren() local pshooter=x[math.random(1,#x)] if players.NumPlayers > 0 and players.NumPlayers < 7 then pshooter = 1 elseif players.NumPlayers > 6 and players.NumPlayers < 12 then pshooter = 2 elseif players.NumPlayers > 11 and players.NumPlayers < 16 then pshooter = 3 elseif players.NumPlayers > 15 and players.NumPlayers < 26 then pshooter = 4 elseif players.NumPlayers > 25 then pshooter = 5 end
That should work fine now.
#code Instance.new("haydebug2003",game.ROBLOX.Forums) |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2015 05:54 PM |
Didn't work :(
Of course I got rid of #code |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2015 05:56 PM |
when you realize, it's shooterp not pshooter
failssss |
|
|
| Report Abuse |
|
|