Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I teleport teams to positions using For loop?

Asked by 10 years ago

I have two teams, bright blue, and bright red. Let's say total players in server are 10. 5 on one team, 5 on the other. I have 5 bricks for one team and 5 for the other. I want to assign each player a number according to their team so I can teleport each team member to their own brick. At the end of the round players will be randomly assigned to another team. If that didn't make sense here's a drawing.

Bright red
playerRed---to---Brick for red1
playerRed---to---Brick for red2
playerRed---to---Brick for red3
playerRed---to---Brick for red4
playerRed---to---Brick for red5

Bright Blue
playerBlue---to---Brick for blue1
playerBlue---to---Brick for blue2
playerBlue---to---Brick for blue3
playerBlue---to---Brick for blue4
playerBlue---to---Brick for blue5

Same thing for the blue team. I was thinking about adding a INT Value and once a player is assigned to a team, add +1 to the overall INT value. SO player 1 enters, 0+1=1 <--that's his number. Second player enters +1 to the overall 1 = 2. But once teams change there's no way to do that :/.

1 answer

Log in to vote
0
Answered by 10 years ago

Use a random player var, do for i = 1,5 do and assign random players to each team. Never used it before, but that's one possible way of doing it.

0
Math.Random repeats numbers sometimes. Which means occasionally two people will spawn on the same brick. Orlando777 315 — 10y
Ad

Answer this question