01 | --// variables //-- |
02 | local gui = game:GetService( "ServerStorage" ):WaitForChild( "Name" ) |
03 |
04 | --// script //-- |
05 | game.Players.PlayerAdded:Connect( function (plr) |
06 | plr.CharacterAdded:Connect( function (char) |
07 | if not char.Head:FindFirstChild( "Name" ) then |
08 | local clone = gui:Clone() |
09 | clone.Thing.plr.Text = plr.Name |
10 | local color = plr.TeamColor.Color |
11 | clone.Thing.plr.TextColor 3 = color |
12 | clone.Thing.rank.Text = plr:GetRoleInGroup( 3135949 ) |
13 | clone.Parent = game.Workspace:WaitForChild(plr.Name).Head |
14 | end |
15 | --// second part //-- |
The second part isn't working, I don't know why.
01 | local Group = game:GetService( "GroupService" ):GetGroupInfoAsync(GROUPID) --this is just if you want the group name |
02 | local GUI = game.ReplicatedStorage.Group |
03 | game.Players.PlayerAdded:Connect( function (player) |
04 | player.CharacterAdded:Connect( function (char) |
05 | local clone = GUI:Clone() |
06 | local color = player.Team.TeamColor.Color |
07 | print (color) |
08 | print (player.Team.Name) |
09 | clone.TextLabel.TextColor 3 = color |
10 | clone.Parent = char:WaitForChild( "Head" ) |
11 | clone.TextLabel.Text = Group.Name.. " Role:" ..player:GetRoleInGroup(GROUPID) |
12 | end ) |
13 | player:GetPropertyChangedSignal( "Team" ):Connect( function () |
14 | local color = player.Team.TeamColor.Color |
15 | print (player.Team.Name) |
16 | print (color) |
17 | game.Workspace [ player.Name ] .Head.Group.TextLabel.TextColor 3 = color |
18 | end ) |
19 | end ) |
Here is a video of it in action!