Jump to content

Skript transforming hex colors into color codes


KingDooms

Recommended Posts

So i've been trying to find an answer to why this has been happening, but idk why. Normally for names i'd like a redish-pink type color, so i use hex colors, but the problem is that the name in chat becomes the red from a color code (&c) while the name in TAB has the hex color. I tried using <##ff8f8f>, tried &#ff8f8f and tried <##ff8f8f>, but no one them worked in skript. Any fix?

Name in chat:
image.png.ecf8415f609059e438a4218fcd4029b5.png

Name in tab:
image.png.b8a3ffbb9224add81ef602368fcdb47c.png

Edited by KingDooms
Link to comment
Share on other sites

24 minutes ago, KingDooms said:

So i've been trying to find an answer to why this has been happening, but idk why. Normally for names i'd like a redish-pink type color, so i use hex colors, but the problem is that the name in chat becomes the red from a color code (&c) while the name in TAB has the hex color. I tried using <##ff8f8f>, tried &#ff8f8f and tried <##ff8f8f>, but no one them worked in skript. Any fix?

Name in chat:
image.png.ecf8415f609059e438a4218fcd4029b5.png

Name in tab:
image.png.b8a3ffbb9224add81ef602368fcdb47c.png

Hmm what are you using to format the chat?

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

No chat plugins, just this code:
 

on chat:
    set chat format to "&7[&a%{level::%player%}%&7] %colored player's prefix% %colored player's displayname% &8»&f %colored message%"


In-game:
image.png.8b4d1f82c17f0f49f4e42542c1e7d4bd.png

Edited by KingDooms
forgot info lol
Link to comment
Share on other sites

27 minutes ago, KingDooms said:

No chat plugins, just this code:
 

on chat:
    set chat format to "&7[&a%{level::%player%}%&7] %colored player's prefix% %colored player's displayname% &8»&f %colored message%"


In-game:
image.png.8b4d1f82c17f0f49f4e42542c1e7d4bd.png

Try formatted instead of colored but don't use it in the message part

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

39 minutes ago, KingDooms said:

Same result as the colored, color codes work but hex color transforms into the color codes.

Code:
image.thumb.png.4314d21bab617d3980361396aa27d720.png


In-game:
image.png.f7374b177f86750ec1b61c34ead96302.png

on chat:
    set {_X} to formatted player's displayname
    set chat format to "&7[&a%{level::%player%}%&7] %colored player's prefix% %{_X}% &8»&f %colored message%"

I doubt this will make a difference but give it a shot if that doesn't work try using this instead:

on chat:
    cancel event
    send formatted "&7[&a%{level::%player%}%&7] %player's prefix% %player's displayname% &8»&f %unformatted message%" to all players

 

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

5 minutes ago, StarBunnie said:
on chat:
    set {_X} to formatted player's displayname
    set chat format to "&7[&a%{level::%player%}%&7] %colored player's prefix% %{_X}% &8»&f %colored message%"

I doubt this will make a difference but give it a shot if that doesn't work try using this instead:

on chat:
    cancel event
    send formatted "&7[&a%{level::%player%}%&7] %player's prefix% %player's displayname% &8»&f %unformatted message%" to all players

 

*sigh* nope. I feel like its because of the server type, because its Paper 1.16.5 but i dont know.

Link to comment
Share on other sites

4 minutes ago, KingDooms said:

*sigh* nope. I feel like its because of the server type, because its Paper 1.16.5 but i dont know.

Hmm doubt it I'm using the second method with the cancel event and it works for me. You could try the workaround CoolProgrammer said in another post to convert the hexcodes into colorcodes like this:

#ff8f8f

&x &f &f &8 &f &8 &f

So basically just give each letter/digit of the hexcode it's own &

#ff8f8f -> &x&f&f&8&f&8&f

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

21 minutes ago, StarBunnie said:

Hmm doubt it I'm using the second method with the cancel event and it works for me. You could try the workaround CoolProgrammer said in another post to convert the hexcodes into colorcodes like this:

#ff8f8f

&x &f &f &8 &f &8 &f

So basically just give each letter/digit of the hexcode it's own &

#ff8f8f -> &x&f&f&8&f&8&f

Same Result

Link to comment
Share on other sites

Just now, KingDooms said:

Same Result

Hmm what confuses me the most is that if Skript can't read a hexcode it usually takes the last letter/digit it can find in the code so in theory it would be &f so your issue where it gets set to &c is really weird. Do you by any chance have another chat format line in another skript file that could be overwriting the one you're changing? We tried a lot of stuff and literally seeing no effect is rather weird/uncommon.

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

6 minutes ago, KingDooms said:

Same Result

heres a line of code that i use that uses hex color formatting. You can try using this? The color is brown, but you can search up a online hex color picker for different colors
 

add ancient debris named "<##614220>Netherite Clicker <##3A2713>- <##614220>[20]" with lore "&6MPC: 7500" to {Clickers::*}

 

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Owner of Lifestealed, Labs, Encore, UNOfficially and Observed
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - 5/8/2024

[MOD] 5/8/2024 - Present

 

Link to comment
Share on other sites

11 minutes ago, AgentGamerPro said:

heres a line of code that i use that uses hex color formatting. You can try using this? The color is brown, but you can search up a online hex color picker for different colors
 

add ancient debris named "<##614220>Netherite Clicker <##3A2713>- <##614220>[20]" with lore "&6MPC: 7500" to {Clickers::*}

 

This works... its brown and everything...

 

17 minutes ago, StarBunnie said:

Hmm what confuses me the most is that if Skript can't read a hexcode it usually takes the last letter/digit it can find in the code so in theory it would be &f so your issue where it gets set to &c is really weird. Do you by any chance have another chat format line in another skript file that could be overwriting the one you're changing? We tried a lot of stuff and literally seeing no effect is rather weird/uncommon.

But I don't have any other skript overwriting the chat format...

Edited by KingDooms
english.mp4
Link to comment
Share on other sites

1 minute ago, KingDooms said:

This works... its brown and everything...

 

But I don't have any other skript overwriting the chat format...

If you haven't tried the version with the cancel event yet I highly recommend to use this I feel like it's an issue with the chat format syntax 

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

7 minutes ago, KingDooms said:

I already did that but again... same result

oh my gosh I might know why mind checking the skript where you set your display name?

 

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

1 minute ago, KingDooms said:

Nono the display name of the player.

You're using 

%colored player's displayname%

So you had to set that somewhere

tumblr_lqahoaPLkC1ql1l0v.gif

Feel free to add me on discord if you:

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with plugins

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need help with skripts

dc3456c-e0ec58e8-c807-43e3-b986-5224b91a need to vent about something

tumblr_lqahoaPLkC1ql1l0v.gif

>[ ‧₊˚꒰ʚ Starshine ɞ ‧✦ *#2683 ]<

Link to comment
Share on other sites

  • 10 months later...

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
×
×
  • Create New...