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.

Solved variable contains text

Discussion in 'Skript' started by loadka95, Aug 18, 2017.

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

    loadka95 Active Member

    Joined:
    Feb 24, 2017
    Messages:
    78
    Likes Received:
    6
    Is the contains thing not works with normal variables? only with list variables?
    I don't get any error, but its still not working

    Code (Skript):
    1. {this.%player%} -> it has some random text in it [bar, fa, saa!]  
    2. if {this.%player%} contains "bar":   #this is not working for me
    3.     message "xyz"
    Is there any other way to check if the variable contains the text?
     
  2. Best Answer:
    Post #2 by ShaneBee, Aug 18, 2017
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    According to the docs: "Checks whether an inventory contains the given item, a text contains another piece of text, or a list of objects (e.g. a {list variable::*}) contains another object."

    Try using if "%{this.%player%}%" contains "bar" instead.
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    231
    Thanks! :emoji_slight_smile:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...