Solved argument contains "&formatcode" does not return true

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

Clooless

Member
Oct 10, 2020
1
0
1
22
So I have a code sort of like this:

Code:
command /example <text>:
    trigger:
        if arg-1 contains "&k":
            send "no"
            exit

however, despite the first argument containing the aforementioned characters, it will not return true. I know this setup works, as if I replace "&k" with non-chat format related characters, it returns successfully. what is going on here, and why can't it detect the characters?

EDIT:
All right! Thanks to some help on the discord server, I eventually reached the conclusion that skript is pre-formatting my text in the contains line, meaning it's trying to look for a magic-formatted nothing, since the format code is the only thing there. The solution is making the contains line state
Code:
if arg-1 contains uncolored "&&k"
this detects the actual characters of the code.

EDIT 2:
welp, months afterward I have discovered the above "solution" does nothing but ban the letter k. after about an hour or so of stressing, I found a better solution that works just fine:
Code:
if colored arg-1 contains "<magic>"
essentially, it pre-formats the arg and checks if it contains a specific kind of formatting. who woulda thunk.
 
Last edited:
Status
Not open for further replies.