I made a simple rank script and it works fine and all, but when I use the debug command using lmm admin or die/respawn, it makes the rank disappear. How could I stop the rank from disappearing?
--Place the script named Rank Script in Workplace
--Place the BillboardGui named Rank in ServerStorage
--Created by centerspell
ranks = {
[0] = Color3.new(255/255, 255/255, 255/255),
[1] = Color3.new(255/255, 255/255, 255/255),
[70] = Color3.new(255/255,0/255,0/255),
[90] = Color3.new(182/255, 54/255, 54/255),
[130] = Color3.new(255/255, 255/255, 0/255),
[140] = Color3.new(255/255, 255/255, 0/255),
[150] = Color3.new(0/255, 255/255, 0/255),
[175] = Color3.new(40/255, 172/255, 40/255),
[210] = Color3.new(0/255, 94/255, 255/255),
[230] = Color3.new(0/255, 230/255, 255/255),
[254] = Color3.new(255/255, 145/255, 0/255),
[255] = Color3.new(222/255, 0/255, 255/255)
}
game.Players.PlayerAdded:connect(function(plr)
local rank = plr:GetRankInGroup(1130688)
local role = plr:GetRoleInGroup(1130688)
if rank ~= 0 then
local rankd = game.ServerStorage.Rank:Clone()
repeat wait() until plr.Character
rankd.Parent = plr.Character.Head
rankd.TextLabel.Text = role
rankd.TextLabel.TextColor3 = ranks[rank]
end
end)
