Replace all help

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

zevo

Member
Aug 22, 2020
4
0
0
17
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
 
Use
Code:
set {_msg} to "%{banlist::*}%"
replace all "and" in {_msg} with ","
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:
command /listban:
    permission: ban.use
    permission message: &4Du har ikke adgang til denne kommando!
    trigger:
        loop {banlist::*}:
            set {msg} to "%{banlist::*}%"
            replace all "and" in {msg} with ","
            send "&8[&6Ban system&8] &6Loader...."
            wait 2 seconds
            send "&8[&6Ban system&8] &6%{banlist::*}%"
            stop
        if {banlist::*} is not set:
            send "&6Listen er tom"
 
Last edited:
You must change your 10th row:
Code:
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"
 
Replacing is a bad solution. Just use this, if I understood the problem correctly.
Code:
send join {banlist::*} by ", "
 
Last edited:
Status
Not open for further replies.