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

How do I connect a team spawn with a group rank?

Asked by
l7mf 2
4 years ago

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.

1 answer

Log in to vote
0
Answered by
manith513 121
4 years ago
Edited 4 years ago

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.

0
oh ty l7mf 2 — 4y
0
Did this work? manith513 121 — 4y
0
if it did please mark it that I answered the question manith513 121 — 4y
Ad

Answer this question