Setting a player's message without editing chat format?

Discussion in 'Skript' started by zacharycram, Jul 16, 2021.

  1. Was wondering how to add colors to a player's message without messing with the chat format, lmk if you have any ideas.

    Tried:
    Code (Text):
    on chat:
        set {_message} to message  
        set message to "&4%{_message}%"


    Code (Text):
    on chat:
      set {_message} to "&4%message%"
      replace all "&" in "%{_message}%" with "ยง"
      set message to "%{_message}%"
    None of them have worked
     
  2. Seems like what you're trying to do is add a color without letting the player change the color as well.
    You should check out Skript Text Formatting.

    Code (Text):
    on chat:
      set message to "<red>%message%"
     
  3. try this:
    Code (Text):
    on chat:
      cancel event
      set {_message} to "&4%message%"
      broadcast "%{_message}%"
    this should work, bc the broadcast function does use the "&" color formatting.

    regards