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

Team Teleporter. Any Help?

Asked by 8 years ago

I'm looking for a script that can activate without being touched or clicked and teleport an entire team to a specific or multiple locations. I want to teleport the Bright red team to one specific area, but the bright blue team to be multiple areas(Different specific positions).

BrickColor.new("Bright blue")
BrickColor.new("Bright red")

or simply

BrickColor.Blue --Blue transmutes to Bright blue in scripts
BrickColor.Red --Red transmutes to Bright red in scripts

1 answer

Log in to vote
1
Answered by
Relatch 550 Moderation Voter
8 years ago

This is pretty simple. Get all the players and move them to a random position, by using a for loop and making sure players aren't sent to the same spawn.

for i, v in pairs(game.Players:GetPlayers()) do --gets all players in a for loop
    if v.TeamColor == "Bright blue" then --if their team is "Bright blue" then
        local bluespawns = workspace:FindFirstChild("BlueSpawns"):GetChildren() --ithis goes into workspace and finds the spawns
        v.Character:MoveTo(bluespawns[i].Position) --teleports them using [i] which means it will be different each time for each player
    end
end

Make sure to read all the lines correctly. Also, if your spawns model is named differently got to line 3 and change ("BlueSpawns") to the name of your spawns model. You can have any amount of spawns. Just make sure you have enough for all players, otherwise there would be an error.

0
Thank you I will check to see if this works! And also can It work with red team also?. CarterTheHippo 120 — 8y
0
Yes, just check if their teamcolor is "Bright red". Relatch 550 — 8y
0
Im not sure why, but it isnt working properly, or the way I want it to. I am having the script pasted into workspace at the time I want my players to be teleported. BlueSpawns is in the workspace, but should blue spawns be a model or seperate parts? CarterTheHippo 120 — 8y
Ad

Answer this question