thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 20 Oct 2013 09:39 AM |
This script works in solo mode, but not in play mode. Anyone know why?
while true do wait(10) players = game.Players:GetChildren()
for i = 1, 2 do Chosen = players[math.random(1,#players)] Chosen.Character:MoveTo(Vector3.new(-5, 43.6, -65.4)) local h = Instance.new("Hint",Chosen.PlayerGui) local m = Instance.new("Message", Chosen.PlayerGui) for i = 60,0,-1 do wait(1) h.Text = i m.Text = i end
for _,v in pairs (game.Players:GetChildren()) do v.Character:BreakJoints() h.Text = "Back to the lobby to strategies!" m.Text = "Back to the lobby to strategies!" wait(3.5) m:Destroy() h:Destroy() wait(10) end end end |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 09:42 AM |
Because the character may not exist or something? wiki.roblox.com |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 09:48 AM |
I think it's this line: Chosen = players[math.random(1,#players)]
Not sure. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 09:52 AM |
@TheRoblox That line would work perfectly most of the time. On the safe side I would do, Chosen = players:children()[math.random(1,#players)] |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 09:56 AM |
Chosen = players:children()[math.random(1,#players)]
That is right, I think it was the error. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 09:56 AM |
Or possibly this: local h = Instance.new("Hint",Chosen.PlayerGui) local m = Instance.new("Message", Chosen.PlayerGui) |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
| |
|
|
| 20 Oct 2013 09:58 AM |
| :children() is the same as :GetChildren() |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 20 Oct 2013 10:01 AM |
| @ProxyKiller, yes, why would I do that? That variable "Player" gets the children, so it's the same thing... |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 10:02 AM |
| I agree with thetacah, I think :GetChildren() means the select children. |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 10:02 AM |
@thetacah But :GetPlayers() is better. http://wiki.roblox.com/index.php/GetPlayers |
|
|
| Report Abuse |
|
|
thetacah
|
  |
| Joined: 18 Jan 2013 |
| Total Posts: 16026 |
|
|
| 20 Oct 2013 10:05 AM |
| @, so now you say I should put :getplayers? |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2013 10:05 AM |
| It's what ever you want to put. |
|
|
| Report Abuse |
|
|