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!