so team a would teleport to one brick and team b would teleport to another brick. how would i do this?
COMMUNITY QUESTION
how would i teleport teams to a certain brick?
1 answer
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
