#Team switcher color/role change not working

10 messages · Page 1 of 1 (latest)

edgy silo
#

GroupRankShower

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Gui = script:WaitForChild("GroupRank")
local groupID = 9335745
local politieGroupID = 9539758

players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        local head = char:FindFirstChild("Head")
        if not head then return end

        local clonedUI = Gui:Clone()
        clonedUI.Parent = head

        clonedUI.BurgerName.Text = player.Name
        clonedUI.PolitieName.Text = player.Name

        if player.Team and player.Team.Name == "Politie" then
            clonedUI.BurgerName.Visible = false
            clonedUI.BurgerRank.Visible = false
            clonedUI.PolitieName.Visible = true
            clonedUI.PolitieRank.Visible = true
            clonedUI.PolitieRank.Text = player:GetRoleInGroup(politieGroupID)
        else
            clonedUI.BurgerName.Visible = true
            clonedUI.BurgerRank.Visible = true
            clonedUI.PolitieName.Visible = false
            clonedUI.PolitieRank.Visible = false
            clonedUI.BurgerRank.Text = player:GetRoleInGroup(groupID)
        end
    end)
end)```
jovial orbitBOT
#

studio** You are now Level 1! **studio

edgy silo
#

Name color should change and rank depending on the RoleInGroup

untold pawn
#

I'm dying 😭

#

tbh idk how to use team service

#

but

#

your code is not very optimised

#

use a

#

for loop

#

I beg