Advertisement
Guest User

Untitled

a guest
May 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. if SERVER then
  2.     AddCSLuaFile("ranksbnamecolor.lua")
  3. end
  4.  
  5. local function rainbow()
  6.     local f = 0.5
  7.     local t = RealTime()
  8.     local r = math.sin( f * t ) * 127 + 128
  9.     local g = math.sin( f * t + 2 ) * 127 + 128
  10.     local b = math.sin( f * t + 4 ) * 127 + 128
  11.     return Color( r, g, b )
  12. end
  13.  
  14. if CLIENT then
  15.     local function colorName( ply )    
  16.                 if ply:IsUserGroup("Mallard") then
  17.                   return rainbow()
  18.                 end
  19.                 if ply:IsUserGroup("server_manager") then
  20.                   return rainbow()
  21.                 end
  22.                 if ply:IsUserGroup("rootadmin") then
  23.                   return Color(252,140,217)
  24.                 end
  25.                 if ply:IsUserGroup("superadmin") then
  26.                   return Color(229,103,23)
  27.                 end
  28.                 if ply:IsUserGroup("admin") then
  29.                   return Color(0,128,0)
  30.                 end
  31.                 if ply:IsUserGroup("supporter") then
  32.                   return Color(255,255,0)
  33.                 end
  34.     end
  35.     hook.Add("TTTScoreboardColorForPlayer", "Color Scoreboard Names", colorName)
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement