Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 05 Nov 2015 08:14 AM |
if game.Players.NumPlayers <=1 then for _,player in pairs(game.Players:GetPlayers()) do if player then player.Character:MoveTo(Vector3.new(math.huge)) end end end
That won't work. Not exactly sure why. I don't usually use NumPlayers so I am trying to learn more about it.
Thanks! |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 08:16 AM |
| I think you meant to do game.Players.NumPlayers >= 1 (greater than or equal to) NOT <= (less than or equal to) |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 05 Nov 2015 08:17 AM |
It's early, sorry, thanks.
Either way it wouldn't work.
I'm trying to create a 'Round' script per say. So once a certain number of players are in the game - stuff happens. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 08:18 AM |
| Should work based on the bits you provided, are you sure its not a problem elsewhere in your script? Also I recommend just adding a bunch of prints throughout the scripts and which ones print. |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 05 Nov 2015 08:19 AM |
It's one script atm.
Should I just use RemoteEvents for this?
It's probably not necessary, but y'know.
Thanks for the advice though, I can give that a shot. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 08:22 AM |
| No, only use remote events/functions when you need to pass data between the client -> <-server. |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
|
| 05 Nov 2015 08:22 AM |
| I'll end up using GUI's locally though. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 08:46 AM |
math.huge is not a vector value, you need to put a vector value inside of Vector3.new(num1,num2,num3) Try Vector3.new(math.huge,math.huge,math.huge) |
|
|
| Report Abuse |
|
|
Dralian
|
  |
| Joined: 21 Mar 2013 |
| Total Posts: 7624 |
|
| |
|
|
| 05 Nov 2015 11:46 AM |
I recommend not using NumPlayers, I would make sure there are 1 or more players with ACTIVE characters.
Also:
local Players = game:GetService("Players"); if Players.NumPlayers >= 1 then
local PlayersChildren = Players:GetPlayers(); for P = 1, #PlayersChildren do PlayersChildren[P]:MoveTo(Vector3.new(math.huge, math.huge, math.huge)); end
end
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 11:52 AM |
| You can't move a player object. |
|
|
| Report Abuse |
|
|
|
| 05 Nov 2015 11:54 AM |
Oh man. :P I knew I was missing something, thanks for picking that up.
local Players = game:GetService("Players");
if Players.NumPlayers >= 1 then local PlayersChildren = Players:GetPlayers(); for P = 1, #PlayersChildren do local Character = PlayersChildren[P].Character; if Character then Character:MoveTo(Vector3.new(math.huge, math.huge, math.huge)); end end end
Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784 |
|
|
| Report Abuse |
|
|