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.

Need Gui Script Shop Help

Discussion in 'Skript' started by MotoXgamer, Dec 30, 2020.

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

    MotoXgamer Member

    Joined:
    Dec 30, 2020
    Messages:
    3
    Likes Received:
    0
    I am creating my script for my shop in my Minecraft server (mine hut) and when i reload the script it says
    "can't understand this condition: "player balance is greater than or is equal to 2000 run" (Shop.sk, line 5: if player balance is greater than or is equal to 2000 run:")"


    this is the full script please help.

    Code (Text):
    1. command /shop:
    2.   trigger:
    3.     open virtual chest inventory with size 3 named "shop" to player
    4.     format gui slot 0 of player with Diamond named "1 Diamond &a$2000"
    5.     if player balance is greater than or is equal to 2000 run:
    6.       execute console command "/eco take 2000"
    7.       execute console command "/give %player% Diamond 1"
    8.       if else:
    9.         send "&cYou Do Not Have Enough Money For This!"
    BTW: i am new to this and have never written script before. i will attach all the plugins i have activated on this server Thank you!

    upload_2020-12-29_20-57-57.png
     
  2. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    i didn't look at the full code so i do not know if there are other errors, however you do not need run at the end of that line.
    Code (Text):
    1. if player's balance is greater than or equal to 2000:
    should suffice:>
     
  3. MotoXgamer

    MotoXgamer Member

    Joined:
    Dec 30, 2020
    Messages:
    3
    Likes Received:
    0

    After i reload the script with the new line of code there is a new thing that popped up>> "Can't compare "player balance" with an integer (Shop.sk, line 5: if player balance is greater than or equal to 2000:")"
     
  4. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    You need to have player's balance, the 's is essential :emoji_slight_smile:
     
  5. MotoXgamer

    MotoXgamer Member

    Joined:
    Dec 30, 2020
    Messages:
    3
    Likes Received:
    0
    ok so i reloaded the script with this
    Code (Text):
    1. command /shop:
    2.   trigger:
    3.     open virtual chest inventory with size 3 named "shop" to player
    4.     format gui slot 0 of player with Diamond named "1 Diamond &a$2000"
    5.     if player's balance is greater than or equal to 2000:
    6.       execute console command "/eco take 2000"
    7.       execute console command "/give %player% Diamond 1"
    8.       if else:
    9.         send "&cYou Do Not Have Enough Money For This!"
    and now it says can't understand this condition: "else" (Shop.sk, line 8: if else:")"


    Thank you for all your help and i have a feeling that this will be the last error message
     
  6. Ankoki

    Moderator Supporter Addon Developer

    Joined:
    Nov 5, 2020
    Messages:
    55
    Likes Received:
    12
    im so sorry what xD i recommend looking at tutorials to learn basic skript.
    if statements should go like this: (remember else if: is optional)
    Code (Text):
    1. if:
    2.     #code
    3. else if: #optional
    4.     #code
    5. else:
    6.     #code
    In conclusion, you need to remove the `if` from `if else` and remove one indent from it and the proceeding lines
     
Thread Status:
Not open for further replies.

Share This Page

Loading...