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 » Scripting Helpers
Home Search
 

Re: Teleporting Teams

Previous Thread :: Next Thread 
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
17 Dec 2011 06:14 PM
im trying to make a script, that will teleport the blue team and the red team to two different places.

Heres my teleport line of code.

player[i].Character:MoveTo(Vector3.new(-37,4.2, -479))

Can someone please tell me what i would need to add so that it only teleports a specific team.
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
17 Dec 2011 06:27 PM
...or you could just use SpawnLocations...
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
17 Dec 2011 06:40 PM
i have it so that there is a spawn building, for my war game. Then when the game starts i want it to teleport each team to there side of the map.
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
17 Dec 2011 06:57 PM
Uhh, here's a rough example of something you can do. Just change the `blue` and `red` variables to the exact colors, and the two Vector3 values to the positions (in the order red, blue).

    local red, blue, redpos, bluepos = "Bright red", "Bright blue", Vector3.new(0, 0, 0), Vector3.new(1, 1, 1)
    
    for k,v in pairs(game.Players:GetPlayers()) do
        if v.TeamColor.Name == red then
            v.Character:MoveTo(redpos)
        elseif v.TeamColor.Name == blue
            v.Character:MoveTo(bluepos)
        end
    end

You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
17 Dec 2011 07:29 PM
Thanks!
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
17 Dec 2011 08:04 PM
No problem.

You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
22 Dec 2011 05:35 PM
ok, i was wondering if someone could break bown this code and explain it to me.Thanks in advanced.

local red, blue, redpos, bluepos = "Bright red", "Bright blue", Vector3.new(-171, 64.2, 223), Vector3.new(180, 64.2, -140)
for k,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor.Name == red then
v.Character:MoveTo(redpos)
elseif v.TeamColor.Name == blue then
v.Character:MoveTo(bluepos)
end
end
Report Abuse
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
22 Dec 2011 06:08 PM
it gets players from the team and teleports them to that location. (vector3)
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
22 Dec 2011 06:20 PM
I understood that part, i know how vector 3 works and all. I was wondering where the for k,v came from, where did the k come from and where did the v come from?
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
23 Dec 2011 12:17 PM
Try reading this wiki article: http://wiki.roblox.com/index.php/Generic_for

If you still don't understand, PM me and I'll explain it to you.

You now have +10 INT from this post. Oh, by the way, Like an __AWESOME__ boss-
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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