|
| 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
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 17 Dec 2011 06:27 PM |
...or you could just use SpawnLocations...
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 22 Dec 2011 06:08 PM |
| it gets players from the team and teleports them to that location. (vector3) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|