How can I connect a spawn with a team? Like, how can I script it so that when a player joins if he's in the group and e. g. rank 2, he'll spawn as "Passenger", if he's rank 200 he'll spawn as "Management Director". Please help.
✓ ANSWER ACCEPTED
How do I connect a team spawn with a group rank?
1 answer
✓ Accepted answer
I am not exactly sure what your variables are but I will give it my best shot.
local groupId = 2723362 --paste the id of the group in here--
local passenger = Instance.new("Team", game.Teams)
passenger.TeamColor = BrickColor.new("Really Red")
passenger.Name = "Passenger"
passenger.AutoAssignable = false
game.Players.PlayerAdded:Connect(function(player)
if player:IsInGroup(groupId) and player:GetRoleInGroup(groupId) = "Rank 2" then
player.TeamColor = BrickColor.new("Really Red")
end
in place where I put Passenger put your Team Name. in the rank section put your group rank you want it to be.
You can toggle the team color if you want and place spawns where you like.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
oh ty
Did this work?
if it did please mark it that I answered the question