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 a word with the same length of chars.

Discussion in 'Skript' started by KroterPvP, Sep 4, 2017.

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

    KroterPvP Active Member

    Joined:
    Apr 10, 2017
    Messages:
    178
    Likes Received:
    7
    Code (Skript):
    1. on chat:
    2.         replace all {OPTIONS::ANTISWEAR::WORDS::*} in message with "%colored {OPTIONS::ANTISWEAR::Word-Replacer}%"
    3. # The "{OPTIONS::ANTISWEAR::Word-Replacer}" equals to "*".
    What I need: When it detects a blocked word, it replaces it with one '*' only. I want it to replace the word with the same '*' as the lenght of the banned word.

    Skript version: Skript 2.2 (dev25) by bensku
    Minecraft version: 1.8.9
    Addons using: SkQuerry-Lime, SkUtilities, Skellett (latest versions).

    I have tried searching the docs and also the forums. I have tried other methods such as google and tring to code it, but I don't know how to do it.

    Errors in console/reload:
    Code (Skript):
    1. No one
    --- Double Post Merged, Sep 5, 2017, Original Post Date: Sep 4, 2017 ---
    BUMP
     
    #1 KroterPvP, Sep 5, 2017
    Last edited: Sep 5, 2017
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Try not to bump, it's kinda annoying for some people.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Yeah, It's also kinda annoting when nobody helps :/
     
    • Agree Agree x 2
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Try looping the anti swear list var and see if the message contains the loop-value.
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    The antiswear runs well, but I want it to replace the banned word with the same '*' as the lenght of the words
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Inside the loop, use "length of loop-value" to get the length of the word and make some function to repeat "*" how many times you want.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...