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

how would i teleport teams to a certain brick?

Asked by
ned995 0
10 years ago

so team a would teleport to one brick and team b would teleport to another brick. how would i do this?

1 answer

Log in to vote
3
Answered by 10 years ago
function getTeamMembers(TeamColor)
    local members = {}
    for i,v in pairs(Game.Players:GetPlayers()) do
        members[#members+1] = v.TeamColor == TeamColor and v or nil --If the player is in the team, ad them to the table.
    end
    return members
end

function teleportTeam(TeamColor, Position)
    for i,v in pairs(getTeamMembers(TeamColor)) do
        repeat wait() until v.Character
        v.Character:MoveTo(Position)
    end
end
--Will add comments when I get the opportunity to.
Ad

Answer this question