Everytime a player join it gives them a different title and doesn’t give them the ranks in this script
game.Players.PlayerAdded:Connect(function(player)
wait(0.4)
local groupRank = player:GetRoleInGroup(groupID)
local Regiment = script.Rank.Frame.Regiment
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = '.'..player.Name..'.'
clone.Frame.Rank.Text = groupRank
wait(0.2)
if player:IsInGroup(10168242) and player:IsInGroup(7501445) and player:IsInGroup(10421551) and player:IsInGroup(10221234) and player:IsInGroup(10718990) == true then
Regiment.Text = "ALL REGIMENTS"
Regiment.TextColor3 = Color3.fromRGB(22,4,5)
elseif player:IsInGroup(10168242) and player:IsInGroup(7501445) and player:IsInGroup(10421551) and player:IsInGroup(10221234) and player:IsInGroup(10718990) ~= false then
Regiment.Text = "NO REGIMENT"
Regiment.TextColor3 = Color3.new(255,0,0)
elseif player:IsInGroup(10168242) then
Regiment.Text = "[ETS]"
Regiment.TextColor3 = Color3.fromRGB(11,222,255)
elseif player:IsInGroup(7501445) then
Regiment.Text = "[SF]"
Regiment.TextColor3 = Color3.new(0,0,0)
elseif player:IsInGroup(10421551) then
Regiment.Text = "[GG]"
Regiment.TextColor3 = Color3.fromRGB(155,22,188)
elseif player:IsInGroup(10221234) then
Regiment.Text = "[RMP]"
Regiment.TextColor3 = Color3.fromRGB(122,99,222)
elseif player:IsInGroup(10718990) then
Regiment.Text = "[LP]"
Regiment.TextColor3 = Color3.fromRGB(110,252,255)
end