Jump to content

Color generator


kalitonchik

Recommended Posts

  • 2 weeks later...

Not entirely sure what you mean but you could do:

addCommandHandler("color", "cmd_changeColor")

cmd_changeColor = function(player, commandname, r, g, b, a)
local mr, mg, mb = getPlayerNametagColor(player)
if not r then r = mr else r = tonumber(r) end
if not g then g = mg else g = tonumber(g) end
if not b then b = mb else b = tonumber(b) end
if not a then a = 170 else a = tonumber(a) end
setPlayerNametagColor(player, r, g, b, a)
end

I don't actually know if setPlayerNametagColor is a function but the get version of it exists so it seems logical. I also don't know if it requires an alpha value, if not it'll just be ignored.

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...