Jump to content

Coloring text in scoreboard column


Avsemsom

Recommended Posts

Hello! I have a script that adds ranks as a scoreboard column, and it all works fine, I just can't get it to show the rank Admin as red, for example.

This is the script:

call(getResourceFromName("scoreboard"),"scoreboardAddColumn","Rank",1,110)

function setRank()
for _,player in ipairs(getElementsByType("player")) do
if isGuestAccount(getPlayerAccount(player)) then
setElementData(player,"Rank","Guest")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin")) then
setElementData(player,"Rank","Admin")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("SuperModerator")) then
setElementData(player,"Rank","Super Moderator")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Moderator")) then
setElementData(player,"Rank","Moderator")
elseif isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Everyone")) then
setElementData(player,"Rank","User")
    end
  end
end
setTimer(setRank,500,0)

Please help, if you can. Thank you!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...