Hello, trying to make it so different ranks have different colors like this below:
local staffcolors = RankColors[ LocalPlayer():GetUserGroup() ]
RankColors = {}
RankColors["superadmin"] = Color( 255, 255, 255 )
RankColors["manager"] = Color( 255, 0, 0 )
chat.AddText( staffcolors, LocalPlayer():GetUserGroup() )
But this gives the error below:
[ERROR] addons/staffchat/lua/staffchat/cl.lua:8: attempt to index global 'RankColors' (a nil value)
1. func - addons/staffchat/lua/staffchat/cl.lua:8
2. unknown - lua/includes/extensions/net.lua:32
I am not sure as to why it is giving this error, any help would be nice!
you're running the lookup on the table before you've defined the table
Ay, yep
Me being a dummy again...
Thanks man!
Sorry, you need to Log In to post a reply to this thread.