Solved Invalid Characters

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

DieserTicket

New Member
Feb 11, 2019
9
0
0
23
Can someone tell me how to forbid all invalid characters in skript?
Like this: %²}}\%➦⬇✺✈➧➲▀

i could do this:
if arg-1 contains "➦" or "⬇" or "✺" or "✈" or "➧" or "➲" or "▀":
message "Nope" to player
stop

but i want to forbid ALL invalid characters. How is that possible in skript?

like this:
if arg-1 contains invalid characters:
message "Nope" to player
stop

How can i do this?
 
Can someone tell me how to forbid all invalid characters in skript?
Like this: %²}}\%➦⬇✺✈➧➲▀

i could do this:
if arg-1 contains "➦" or "⬇" or "✺" or "✈" or "➧" or "➲" or "▀":
message "Nope" to player
stop

but i want to forbid ALL invalid characters. How is that possible in skript?

like this:
if arg-1 contains invalid characters:
message "Nope" to player
stop

How can i do this?
You could make a list of all allowed characters and replace those in a local variable which contains the message with "". If the local variable is "" after you've replaced the allowed characters, then the message is allowed. If it isn't "", it contains characters that aren't allowed.
 
You could make a list of all allowed characters and replace those in a local variable which contains the message with "". If the local variable is "" after you've replaced the allowed characters, then the message is allowed. If it isn't "", it contains characters that aren't allowed.
Could you make an example for me?
 
if arg-1 doesn't contain "a" or "b" or "c" or *go on like this with all characters that are ALLOWED*
stop
 
if arg-1 doesn't contain "a" or "b" or "c" or *go on like this with all characters that are ALLOWED*
stop
If you do that you will need to type every allowed character in the message for the message to be allowed...
 
no if you have only one of those characters it will be allowed
[doublepost=1560792187,1560791833][/doublepost]I just tested it and it works fine how I explained it. Just add every allowed characters to it and if it contains one of the allowed messages it will be allowed.
upload_2019-6-17_19-28-28.png


Code:
command /test <string>:
    trigger:
        if arg-1 doesn't contain "a" or "b":
            message "no contain"
        else:
            message "yes contain (%arg-1%)"
doesn't work for me
 
You can manually make a variable / list ingame with all forbidden words:

command /addforbiddenword [<text>]:
permission: djawdj
trigger:
if arg-1 is set:
add arg-1 to {forbidwords::*}
 
Code:
                    set {_c} to "%arg-2%"
                    loop {allowed.characters::*}
                        remove "%loop-value%" from {_c}
                    if {_c} is not "":
                        message "{@Prefix} &7Invalid Character!"
                        stop
 
Status
Not open for further replies.