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 Can't compare 'player's exp level' with an integer

Discussion in 'Skript' started by HypeForMe, Sep 19, 2019.

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

    HypeForMe Member

    Joined:
    Sep 8, 2019
    Messages:
    2
    Likes Received:
    0
    Hello, I am having a problem with skript.

    Code (Text):
    1. on click:
    2.     if the 4th line of the lore of the player's tool is "&8Level 3":
    3.         if player's level is lower or equal to 2:
    4.             damage player by 5 hearts
    5.             send "&c&lYou are not high enough level to use this item." to the player
    That is the skript I am trying to run, but it gives me this error when I try to run it.

    Code (Text):
    1. Can't compare 'player's exp level' with an integer (level.sk, line 3: if player's exp level is less than or equal to 1:')
    Could it be my skript version?
     
  2. Poons

    Supporter

    Joined:
    Jan 25, 2017
    Messages:
    8
    Likes Received:
    2
    try using "player's xp"
    Code (Text):
    1. on click:
    2.     if player's xp > 1:
    3.         send "hi"
     
  3. HypeForMe

    HypeForMe Member

    Joined:
    Sep 8, 2019
    Messages:
    2
    Likes Received:
    0
    After doing some digging on the internet I have found that I can not use "lower or equal to" I have to use "greater or equal to" with an "else" statement to tell skript that I am looking for a lower number
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    its because lower isn't a syntax, but you can use lesser or smaller
    see the docs
    Comparison
     
Thread Status:
Not open for further replies.

Share This Page

Loading...