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.

Replace in message

Discussion in 'Skript' started by MateoxPL, Jan 25, 2019.

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

    MateoxPL Active Member

    Joined:
    Jan 27, 2018
    Messages:
    116
    Likes Received:
    0
    Hello how to replace in message some word for one
    example
    player type on chat: Text Text Text Text Text Text or Text Message Text

    and I want it to change only one word text and the others removed:
    > Text message
     
  2. Dave

    Dave Active Member

    Joined:
    Jul 20, 2018
    Messages:
    228
    Likes Received:
    9
    Uhm, maybe this?
    Code (Text):
    1. on chat:
    2.     if message contains "text text text text text text ":
    3.         replace all "text text text text text text" with "text" in message
     
    • Informative Informative x 1
  3. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Try this:
    Code (Text):
    1. on chat:
    2.     set {_l::*} to split message at " "
    3.     loop {_l::*}:
    4.         {_l2::*} does not contain loop-value
    5.         add loop-value to {_l2::*}
    6.     set message to (join {_l2::*} with " ")
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...