Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Lua 

TTT Scoreboard Ranks



1. Open up sb_row.lua (gamemode/vgui/sb_row.lua)

Add:
Code
self.cols[5] = vgui.Create("DLabel", self)
self.cols[5]:SetText("Rank")

After:
Code
if KARMA.IsEnabled() then
      self.cols[4] = vgui.Create("DLabel", self)
      self.cols[4]:SetText(GetTranslation("sb_karma"))
   end

--------------------------------------------------------------------

Add:
Code
if ply:IsUserGroup("owner") then
self.cols[5]:SetText("Owner")
self.cols[5]:SetTextColor(Color(0,178,238,255))
end

To add more ranks remove "end" from the code and add:

Code
else if ply:IsUserGroup("admin") then
self.cols[5]:SetText("Admin")
self.cols[5]:SetTextColor(Color(238,0,0,255))

Remember to type "end" when your finished adding the ranks.

After:
Code
if self.cols[4] then
      self.cols[4]:SetText(math.Round(ply:GetBaseKarma()))
   end

-------------------------------------------------------------------

1. Open up sb_row.lua (gamemode/vgui/sb_row.lua)

Add:
Code
self.cols[5] = vgui.Create( "DLabel", self )
self.cols[5]:SetText("Rank")

After:
Code
if KARMA.IsEnabled() then
      self.cols[4] = vgui.Create("DLabel", self)
      self.cols[4]:SetText(GetTranslation("sb_karma"))
   end

------------------------------------------------------------------

If your having a bit of trouble setting it up, I have added MY FILES for you to work off.

------------------------------------------------------------------

You can send me a private message if you have a request for a LUA tutorial I can do.
Enjoy 👍
Nice blur out, "[CBC] Boss." Lol, anyway, nice tutorial.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Lua] by Mr RobotoJun 26, 2022 04:21 PM 1 209 Jun 26, 2022 04:21 PM
Last Post: SetLost
[Lua] by Dr PlagueFeb 8, 2015 02:47 PM 17 1,265 Feb 8, 2015 02:47 PM
Last Post: sodak
[Lua] by incapFeb 2, 2015 12:14 AM 8 700 Feb 2, 2015 12:14 AM
Last Post: haffy