So i made a rank script that shows your group rank above your head, it works fine and all but when someone gets promoted or demoted, it doesn't update automatically if i use the debug command from Lua Admin and i was wondering how i can make it update after using the debug command. This is what i have.
game.Workspace.ChildAdded:connect(function(obj) if (obj:IsA("Hat")) then wait(1) if (obj.Parent == game.Workspace) then obj:Destroy() end end end) groupid = 1148703 game.Players.PlayerAdded:connect(onPlayerRespawned) function onPlayerRespawned(newPlayer) wait(1) if newPlayer:IsInGroup(groupid) then guigroup=Instance.new("BillboardGui") guigroup.Parent=newPlayer.Character.Head guigroup.Adornee=newPlayer.Character.Head guigroup.Size=UDim2.new(4,0,2,0) guigroup.StudsOffset=Vector3.new(0,2.5,0) textgroup=Instance.new("TextLabel") textgroup.Size=UDim2.new(1,0,1,0) textgroup.BackgroundTransparency = 1 textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) textgroup.TextStrokeTransparency = 0 textgroup.TextTransparency = 0 textgroup.FontSize = 'Size24' UnrefinedRank = newPlayer:GetRankInGroup(groupid) UnrefinedColor = newPlayer:GetRankInGroup(groupid) Person = newPlayer.Name if UnrefinedRank and UnrefinedColor == 255 then UnrefinedRank = "Mod King" textgroup.TextColor3 = Color3.new(129/255, 90/255, 220/255) end if UnrefinedRank and UnrefinedColor == 245 then UnrefinedRank = "Group Owner" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 235 then UnrefinedRank = "Co-Owner" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 225 then UnrefinedRank = "Developer" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 218 then UnrefinedRank = "Chief Executive Officer" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 217 then UnrefinedRank = "Chief Operational Officer" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 216 then UnrefinedRank = "Chief Staff Officer" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 215 then UnrefinedRank = "Head-Administrator" textgroup.TextColor3 = Color3.new(20/255, 212/255, 110/255) end if UnrefinedRank and UnrefinedColor == 205 then UnrefinedRank = "Administrator" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 195 then UnrefinedRank = "Manager" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 185 then UnrefinedRank = "Supervisor" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 175 then UnrefinedRank = "Head-Moderator" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 165 then UnrefinedRank = "Moderator" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 155 then UnrefinedRank = "Trial-Moderator" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 145 then UnrefinedRank = "Abuse Reporter" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end if UnrefinedRank and UnrefinedColor == 10 then UnrefinedRank = "Member" textgroup.TextColor3 = Color3.new(255/255, 255/255, 255/255) end textgroup.Text = (' ' .. UnrefinedRank .. " ") textgroup.Parent=guigroup end end function onPlayerEntered(newPlayer) newPlayer.Changed:connect(function (property) if (property == "Character") then onPlayerRespawned(newPlayer) end end) end game.Players.PlayerAdded:connect(onPlayerEntered)