Colored chat with HEX codes

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

TheMangoCrew

Member
Nov 15, 2020
11
0
1
27
I'm trying to make a skript so it can set my chat message's color to the hex color, since 1.16 added support for it, but I can't skript well, so it obviously had some errors. Could someone help fixing it?

The skript is:
Code:
command /color2 [<text>]:
  trigger:
    arg_1 is "reset":
      delete {chatColor::%player%}
      execute console command "menu open color-success %player%"
      stop
    arg_1 is "rgb"
    send "&8&l>> &cEnter a Hex color in chat! Example: &e##ffffff" to player
    set {blocck.%player%} to 1
    wait 15 second
    {blocck.%player%} doesn't exist:
      stop
    send "&8&l>> Cancelled."
    delete {blocck.%player%}

on chat:
  {blocck.%player%} is 1:
    cancel event
    set {_L} to lenght of message
    {_L} is larger than 7:
      send"&8&l>> &cInvalid color code!" to player
      stop
    {_L} is smaller than 7:
      send"&8&l>> &cInvalid color code!" to player
      stop
    message contain "##" or "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "a" or "b" or "c" or "d" or "e" or "f":
      delete {blocck.%player%}
      set {chatColor::%player%} to "%message%"
      stop
    send "&8&l>> &cInvalid color code!"
    stop
  {chatColor::%player%} is set:
    set message to coloured "%{chatColor::%player}%%message%"
    stop
 
Realistically it'd be easier to download Essentialschat into your server. You'll also need Vault I noticed.

Essentials chat is just an easy way to color your chat with color codes.

Alternate way:
You could also just get a ChatColor plugin!
 
Hey ma boi
For sure its possible.
You need the send formatted "" and hex-codes should look lik"<##00ff00>"
Then it should works in chat/items/lores/tooltips and everywhere
 
I'm trying to make a skript so it can set my chat message's color to the hex color, since 1.16 added support for it, but I can't skript well, so it obviously had some errors. Could someone help fixing it?

The skript is:
Code:
command /color2 [<text>]:
  trigger:
    arg_1 is "reset":
      delete {chatColor::%player%}
      execute console command "menu open color-success %player%"
      stop
    arg_1 is "rgb"
    send "&8&l>> &cEnter a Hex color in chat! Example: &e##ffffff" to player
    set {blocck.%player%} to 1
    wait 15 second
    {blocck.%player%} doesn't exist:
      stop
    send "&8&l>> Cancelled."
    delete {blocck.%player%}

on chat:
  {blocck.%player%} is 1:
    cancel event
    set {_L} to lenght of message
    {_L} is larger than 7:
      send"&8&l>> &cInvalid color code!" to player
      stop
    {_L} is smaller than 7:
      send"&8&l>> &cInvalid color code!" to player
      stop
    message contain "##" or "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9" or "a" or "b" or "c" or "d" or "e" or "f":
      delete {blocck.%player%}
      set {chatColor::%player%} to "%message%"
      stop
    send "&8&l>> &cInvalid color code!"
    stop
  {chatColor::%player%} is set:
    set message to coloured "%{chatColor::%player}%%message%"
    stop
i got it

&#00ff00
try that
 
Status
Not open for further replies.