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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to replace specific color codes in message?

Discussion in 'Skript' started by tycoo, Nov 17, 2022.

Thread Status:
Not open for further replies.
  1. tycoo

    tycoo Member

    Joined:
    Nov 17, 2022
    Messages:
    4
    Likes Received:
    0
    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 (Text):
    1. on chat:
    2.     cancel event
    3.     set {_msg} to message
    4.     replace all "&5" with "" in {_msg}
    5.     send {_msg} to all players
     
  2. iFammYT

    iFammYT Member

    Joined:
    Nov 6, 2022
    Messages:
    13
    Likes Received:
    1
    Code (Text):
    1. on chat:
    2.     if message contains "&5":
    3.         replace all "&5" with "" in message
    thank me whenever u want :emoji_smile:
     
  3. tycoo

    tycoo Member

    Joined:
    Nov 17, 2022
    Messages:
    4
    Likes Received:
    0
    nothing changed in result
    [​IMG]
     
  4. iFammYT

    iFammYT Member

    Joined:
    Nov 6, 2022
    Messages:
    13
    Likes Received:
    1
    is there a chat plugin or skript your using?
     
  5. tycoo

    tycoo Member

    Joined:
    Nov 17, 2022
    Messages:
    4
    Likes Received:
    0
    I'm using my own chat skript and want to add ablilty to give players permissions to use specific colorcodes
     
  6. iFammYT

    iFammYT Member

    Joined:
    Nov 6, 2022
    Messages:
    13
    Likes Received:
    1
    i tested it and it works
    --- Double Post Merged, Nov 18, 2022, Original Post Date: Nov 18, 2022 ---
    Code (Text):
    1. on chat:
    2.     if message contains "&5":
    3.         if player does not have permission "color.5":
    4.             replace all "&5" with "" in message
    try this
    remove the perm and try
    --- Double Post Merged, Nov 18, 2022 ---
    also maybe it doesnt work for ops
     
  7. tycoo

    tycoo Member

    Joined:
    Nov 17, 2022
    Messages:
    4
    Likes Received:
    0
    doesn't work for me. Maby you have any addons that make this code work?

    my addons:
    [​IMG]
     
  8. iFammYT

    iFammYT Member

    Joined:
    Nov 6, 2022
    Messages:
    13
    Likes Received:
    1
    idk then
    sorry
     
Thread Status:
Not open for further replies.

Share This Page

Loading...