|
| 11 Aug 2010 10:28 PM |
I am brand new to scripting and I haveent even read the whole tutorial. I was thinking it would go something like this game.Workspace.Players.:chooserandom() Is that ANYTHING like what it would look like? |
|
|
| Report Abuse |
|
|
bosox5
|
  |
| Joined: 25 Jun 2009 |
| Total Posts: 908 |
|
|
| 11 Aug 2010 10:29 PM |
| Sort of... I guess... Its gonna be longer than that tho. |
|
|
| Report Abuse |
|
|
harutsedo
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 5150 |
|
|
| 11 Aug 2010 10:29 PM |
No.
player=game.Players:GetChildren()[math.random(1,game.Players.NumPlayers)] |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2010 10:31 PM |
Okay, say both you and I were in a random game, and this scrit was ran.
function getRandomPlayer() x = game.Players:GetChildren() return x[math.random(1,#x)] end
print(getRandomPlayer().Name) print(getRandomPlayer().Name) print(getRandomPlayer().Name) >DidYouSeeThatDog >freedomfighters >freedomfighters
the function getRandomPlayer(), returns a random player :3
so you could use this aswell :P getrandomPlayer().Character:BreakJoints() |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2010 10:36 PM |
@DidYouSeeThatDog With BreakJoints() at the end, what would that do to help? What if I wanted to teleport everyone else to a certain location but the person randomly selected. Then teleport the selected player to the location the other players were teleported. |
|
|
| Report Abuse |
|
|
|
| 11 Aug 2010 10:42 PM |
BreakJoints() will kill humanoids if they are children of something that has its joints broken.
function getRandomPlayer() x = game.Players:GetChildren() return x[math.random(1,#x)] end
x = getRandomPlayer() --gets the special person who wont be tele'd y = game.Players:GetChildren() l = Vector3.new(math.random(-256,256),10,math.random(-256,256))) -- makes the teleport point for i=1,#y do if y[i] ~= x then y[i].Character:MoveTo(l) --moves everyone to the teleport point end end
wait(5)
x.Character:MoveTo(l) -- moves the special person to the teleport point
Its been a while so I cant remember if MoveTo() works that way, anyway, do you understand that ? |
|
|
| Report Abuse |
|
|
| |
|
OBF
|
  |
| Joined: 29 Sep 2009 |
| Total Posts: 10709 |
|
|
| 11 Aug 2010 10:47 PM |
@Did BreakJoints removes welds. Without a neck weld, we die, explaining why BreakJoints kills. |
|
|
| Report Abuse |
|
|