TheProMJoin Date: 2013-03-27 Post Count: 436 |
Pick random player? how? i need it for gamescript |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
local randomPlayer = Game.Players:GetPlayers()[math.random(Game.Players.NumPlayers)]; |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
game.Players:GetChildren()[math.random(1,#game.Players.NumPlayers)] |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
oops i put # of a property |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
That would be fine if the property's value was a table, but it's an integer in this case |
|
TheProMJoin Date: 2013-03-27 Post Count: 436 |
local randomPlayer = Game.Players:GetPlayers()[math.random(Game.Players.NumPlayers)];
workspace.Feed.Value = "Boss: "..randomPlayer.name.." "
got error on that one |
|
youssef04Join Date: 2011-01-22 Post Count: 1745 |
Remove the ".name" |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
Make it .Name |
|
TheProMJoin Date: 2013-03-27 Post Count: 436 |
I tried this
workspace.Feed.Value = "Boss: "..randomPlayer.Name
And worked.
Thanks everyone :) |
|
TheProMJoin Date: 2013-03-27 Post Count: 436 |
Is it possible to give everyone a weapon in lighting. and randomplayer.Name special weapon? |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
for k,v in pairs(game.Players:children()) do
if v.Name~=randomPlayer.Name then
game.Lighting.tool:clone().Parent=v.Backpack
else
game.Lighting.specialtool:clone().Parent=v.Backpack end end |
|
TheProMJoin Date: 2013-03-27 Post Count: 436 |
Ok. Thank you cx
Now i'm at 'when boss' dies. it end the game |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
randomPlayer.Character.Humanoid.Died:connect(function()
|
|
UncleTazJoin Date: 2009-08-19 Post Count: 12795 |
Damn smiley you just wrote his whole game -_-' |
|
smiley599Join Date: 2010-01-23 Post Count: 21869 |
Yeah I was thinking just that.
Oh well, he's learning I hope. |
|
TheProMJoin Date: 2013-03-27 Post Count: 436 |
Lol.
I actually learned something from last time you helped me o.o |
|