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 all help

Discussion in 'Skript' started by zevo, Aug 22, 2020.

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

    zevo Member

    Joined:
    Aug 22, 2020
    Messages:
    4
    Likes Received:
    0
    command /listban:
    permission: ban.use
    permission message: &4Du har ikke adgang til denne kommando!
    trigger:
    loop {banlist::*}:
    send "&6%{banlist::*}%"
    replace all "and" with "," in {_banlist::*}
    stop
    if {banlist::*} is not set:
    send "&6Listen er tom"[/CODE]


    When i run this skript, it says:

    'replace all "and" with "," in {banlist:**} ' can only accept a single text, not more

    Please help
     
  2. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    206
    Likes Received:
    20
    Use
    Code (Text):
    1. set {_msg} to "%{banlist::*}%"
    2. replace all "and" in {_msg} with ","
    3.    
     
  3. zevo

    zevo Member

    Joined:
    Aug 22, 2020
    Messages:
    4
    Likes Received:
    0
    it didn't work, it removes the error, but when i run the command, it says: Dyrberg and Dyrberg. i want it saying: Dyrberg, Dyrberg.

    it looks like this now:

    Code (Text):
    1. command /listban:
    2.     permission: ban.use
    3.     permission message: &4Du har ikke adgang til denne kommando!
    4.     trigger:
    5.         loop {banlist::*}:
    6.             set {msg} to "%{banlist::*}%"
    7.             replace all "and" in {msg} with ","
    8.             send "&8[&6Ban system&8] &6Loader...."
    9.             wait 2 seconds
    10.             send "&8[&6Ban system&8] &6%{banlist::*}%"
    11.             stop
    12.         if {banlist::*} is not set:
    13.             send "&6Listen er tom"
     
    #3 zevo, Aug 22, 2020
    Last edited: Aug 22, 2020
  4. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    206
    Likes Received:
    20
    You must change your 10th row:
    Code (Text):
    1. send "&8[&6Ban system&8] &6%{msg}%"
    Also I recommend you to change all of {msg} to {_msg} cause it'll be "only-this-command variable"
     
  5. Romitou

    Romitou New Member

    Joined:
    Jun 2, 2019
    Messages:
    8
    Likes Received:
    4
    Replacing is a bad solution. Just use this, if I understood the problem correctly.
    Code (Text):
    1. send join {banlist::*} by ", "
     
    #5 Romitou, Aug 27, 2020
    Last edited: Aug 27, 2020
    • Informative Informative x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...