I made a rank script that is supposed to show your group rank over your head in a certain color. It shows your rank number instead of the name and it isn't colored. Please help me fix this script since i don't know what is wrong with it. I have tried multiple things like changing role to rank, keeping it just if role == "rank name" or just if rank == rank number. There are no errors in the console.
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
local rank = plr:GetRankInGroup(1148703)
local role = plr:GetRoleInGroup(1148703)
local color = Color3.new(255/255, 255/255, 255/255)
if rank == 0 and role == "Guest" then
role = "Guest"
color = color3.new(255/255, 255/255, 255/255)
elseif rank == 10 and role == "Member" then
role = "Member"
color = Color3.new(255/255, 255/255, 255/255)
elseif rank == 145 and rank == "Abuse Reporter" then
role = "Abuse Reporter"
color = Color3.new(117/255, 69/255, 71/255)
elseif rank == 155 and role == "Trial-Moderator" then
role = "Trial-Moderator"
color = Color3.new(0/255, 0/255, 0/255)
elseif rank == 165 and role == "Moderator" then
role = "Moderator"
color = Color3.new(52/255, 117/255, 0/255)
elseif rank == 175 and role == "Head-Moderator" then
role = "Head-Moderator"
color = Color3.new(255/255, 149/255, 0/255)
elseif rank == 185 and role == "Supervisor" then
role = "Supervisor"
color = Color3.new(17/255, 0/255, 255/255)
elseif rank == 195 and role == "Manager" then
role = "Manager"
color = Color3.new(117/255, 107/255, 255/255)
elseif rank == 205 and role == "Administrator" then
role = "Administrator"
color = Color3.new(54/255, 14/255, 255/255)
elseif rank == 215 and role == "Head-Administrator" then
role = "Head-Administrator"
color = Color3.new(19/255, 255/255, 7/255)
elseif rank == 216 and role == "Chief Staff Officer" then
role = "Chief Staff Officer"
color = Color3.new(139/255, 1/255, 132/255)
elseif rank == 217 and role == "Chief Operational Officer" then
role = "Chief Operational Officer"
color = Color3.new(254/255, 255/255, 180/255)
elseif rank == 218 and role == "Chief Executive Officer" then
role = "Chief Executive Officer"
color = Color3.new(1/255, 74/255, 74/255)
elseif rank == 225 and role == "Developer" then
role = "Developer"
color = Color3.new(138/255, 138/255, 138/255)
elseif rank == 235 and role == "Co-Owner" then
role = "Co-Owner"
color = Color3.new(8/255, 255/255, 239/255)
elseif rank == 245 and role == "Group Owner" then
role = "Group Owner"
color = Color3.new(255/255, 8/255, 235/255)
elseif rank == 255 and role == "Mod King -Owner-" then
role = "Mod King -Owner-"
color = Color3.new(255/255, 0/255, 0/255)
end
print(plr.Name.." just joined with rank '"..role.."'")
if rank ~= "Guest" then
local rankd = game.ServerStorage.Rank:Clone()
rankd.Parent = char.Head
rankd.TextLabel.Text = rank
rankd.TextLabel.TextColor3 = color
end
end)
end)

2 comments
Is this inside a LocalScript?
This is a server side script that connects with a gui inside of Server Storage