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

I need help with a script?

Asked by
Prioxis 673 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

So I have script that teleports players but I have 2 teams and the script teleports all of them to the same place how would I make it teleport people on one team somewhere and the other team somewhere else

0
Don't repost a question PiggyJingles 358 — 10y
0
This isn't a repost stupid Prioxis 673 — 10y

2 answers

Log in to vote
1
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
10 years ago
local locations={
    ["Bright blue"]=Vector3.new(200,10,0),
    ["Bright red"]=Vector3.new(-200,10,0),
    ["Bright green"]=Vector3.new(0,10,200),
    ["Bright yellow"]=Vector3.new(0,10,-200)
}
for _,v in pairs(game.Players:GetPlayers())do
    if v.Character then
        v.Character:MoveTo(locations[tostring(v.TeamColor)])
    end
end

Change the positions of the teams by name of their color (not by name of the team) in the table.

Ad
Log in to vote
0
Answered by
Hybric 271 Moderation Voter
10 years ago

Im going to make a guess, Use this for the part

local p = game.Players:GetChildren()
for s = 1, #p do
if p[s].TeamColor == "TEAM COLOR 1 HERE" then
p[s].Character:MoveTo(Vector3.new(PASTE POSITION HERE))
else
if p[s].TeamColor == "TEAM COLOR 2 HERE" then
p[s].Character:MoveTo(Vector3.new(PASTE POSITION FOR TEAM 2 HERE))

-- IF YOUR SCRIPT ADD THREE ENDS TO IT SO IT WILL WORK

Answer this question