generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Dividing players up and then teleporting them

Previous Thread :: Next Thread 
Guest_2287 is not online. Guest_2287
Joined: 04 Jan 2013
Total Posts: 227
03 Sep 2016 05:34 PM
Is there anyway I could do something like this:
Say I have a number of players in a game (take 24 for an example)
I divide this up using code (that I don't know how to do)
Then, say on my map I have 4 different 'spawns' (actually teleport locations)
I want to teleport 6 of these players onto one 'spawn' and then the other 6 on the next and then the other 6 on the next (you get the point).

Is there any way to do this?
Thanks
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
03 Sep 2016 05:39 PM
if team % 2 then
-- Code here
else
-- Code here
end
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
03 Sep 2016 05:41 PM
Allow me to fix my earlier code

local p = game.Players:GetChildren()

for i, v in pairs(p) do
if i % 2 then
-- Team 1 code
else
-- Team 2 code
end
end
Report Abuse
Guest_2287 is not online. Guest_2287
Joined: 04 Jan 2013
Total Posts: 227
03 Sep 2016 06:37 PM
sorry, i didnt mean it like that
the players aren't on teams..
Report Abuse
xxsquidisrarexx is online. xxsquidisrarexx
Joined: 06 Feb 2014
Total Posts: 118
03 Sep 2016 06:42 PM
Not sure if theres an easy way todo this i started learning lua yesterday so i barely know anything but i guess an good solution would just making it select random people for example you have 10 people on there then it will choose 5 random people for each spawn point and if theres 11 it would still just randomise
Report Abuse
Guest_2287 is not online. Guest_2287
Joined: 04 Jan 2013
Total Posts: 227
03 Sep 2016 06:50 PM
what I was thinking
but i dont know how to do it!
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
03 Sep 2016 06:53 PM
local players = game.Players
local halfplayers = #players / 2

local spawns = game.Map.Spawns
local spawn = game.Map.Spawns:GetChildren

halfplayers.Position = spawn.Position + Vector3.new(0, 3, 0)

this is hard for me this wouldve taken a long time for me to figure out but try this out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image