How to replace specific color codes in message?

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

tycoo

Member
Nov 17, 2022
4
0
1
19
When I use "&5" in my chat message, it basicaly doing nothing with it. I can replace only "&" with "", but there will be "5" in the message.

Code:
on chat:
    cancel event
    set {_msg} to message
    replace all "&5" with "" in {_msg}
    send {_msg} to all players
 
Code:
on chat:
    if message contains "&5":
        replace all "&5" with "" in message

thank me whenever u want :emoji_smile:
 
Code:
on chat:
    if message contains "&5":
        replace all "&5" with "" in message

thank me whenever u want :emoji_smile:
nothing changed in result
image.png
 
i tested it and it works
[doublepost=1668778066,1668778017][/doublepost]
Code:
on chat:
    if message contains "&5":
        if player does not have permission "color.5":
            replace all "&5" with "" in message

try this
remove the perm and try
[doublepost=1668778097][/doublepost]also maybe it doesnt work for ops
 
i tested it and it works
[doublepost=1668778066,1668778017][/doublepost]
Code:
on chat:
    if message contains "&5":
        if player does not have permission "color.5":
            replace all "&5" with "" in message

try this
remove the perm and try
[doublepost=1668778097][/doublepost]also maybe it doesnt work for ops
doesn't work for me. Maby you have any addons that make this code work?

my addons:
image.png
 
Status
Not open for further replies.