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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Teleporting players to unique spawn

Previous Thread :: Next Thread 
electricfirestorm is not online. electricfirestorm
Joined: 18 Nov 2009
Total Posts: 133
11 Jul 2016 11:23 AM
I need some help in coming up with a script that will teleport all players (It's for a minigame) to each individual spawn points, So player 1 will spawn on spawn1 and player 2 would spawn on spawn2 so forth. Any ideas?

Regards.


Report Abuse
SpeedyJZoel is not online. SpeedyJZoel
Joined: 16 Aug 2010
Total Posts: 2416
11 Jul 2016 11:38 AM
local spawns=[pathline to spawns here]:GetChildren()
local plrs=game.Players:GetChildren()

if #spawns>=#plrs then
for i = 1,#plrs do
repeat wait() until plrs[i].Character
plrs[i].Character:MoveTo(spawns[i].Position+Vector3.new(0,3,0))
end
else
print('Not enough spawns for everyone')
end


Speedy J. Zoel || Robux: R$1,312 || RAP: R$80,994
Report Abuse
devHoodie is not online. devHoodie
Joined: 04 Nov 2008
Total Posts: 30332
11 Jul 2016 11:44 AM
function TeleportPlayers(SPAWNS) --assuming SPAWNS is a table and #SPAWNS = #PLAYERS
for i1,SPAWN in pairs (SPAWNS) do
for i2,PLR in pairs (game.Players:GetPlayers()) do
if i2 == i1 then
local CHAR = PLR.Character or PLR.CharacterAdded:wait()
CHAR:MoveTo(SPAWN.Position+Vector3.new(0,3,0)) -- why
end
end
end
end

Report Abuse
electricfirestorm is not online. electricfirestorm
Joined: 18 Nov 2009
Total Posts: 133
11 Jul 2016 11:46 AM
Spawns are not currently a table, they are individual bricks at different location of the specific minigame.


Report Abuse
SpeedyJZoel is not online. SpeedyJZoel
Joined: 16 Aug 2010
Total Posts: 2416
11 Jul 2016 11:46 AM
@Above Yours is much more inefficient, as it cycles through the players table trying to find a number match.


Speedy J. Zoel || Robux: R$1,312 || RAP: R$80,994
Report Abuse
electricfirestorm is not online. electricfirestorm
Joined: 18 Nov 2009
Total Posts: 133
11 Jul 2016 02:52 PM
How would I go about checking which players survived the round?


Report Abuse
electricfirestorm is not online. electricfirestorm
Joined: 18 Nov 2009
Total Posts: 133
12 Jul 2016 06:33 AM
Any ideas?


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