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 Help. Can't make player buy

Discussion in 'Skript' started by YaPotato, Mar 19, 2020.

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

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    it doesn't give any errors but it doesnt work. When i open the gui and try to buy it doesn't do anything

    My skript:
    command /shop:
    trigger:
    open virtual chest inventory with size 3 named "&l&bShop" to player
    format gui slot 10 of player with chest named "Box" with lore "100$" to run:
    if player's money is greater than 99:
    execute command "/eco take %player% 100"
    give player 1 of chest named "Box"
    send "Successfully bought" to player
    close player's inventory
    else:
    send "Get more money" to player
    format gui slot 13 of player with 10 chest named "Box" with lore "900$" to run:
    if player's money is greater than 899:
    execute command "/eco take %player% 900"
    give player 10 of chest named "Box"
    send "Successfully bought" to player
    close player's inventory
    else:
    send "Get more money" to player
    format gui slot 16 of player with 25 chest named "Box" with lore "2365$" to run:
    if player's money is greater than 2364:
    execute command "/eco take %player% 2365"
    give player 25 of chest named "Box"
    send "Successfully bought" to player
    close player's inventory
    else:
    send "Get more money" to player
     
  2. Potato

    Potato Active Member

    Joined:
    Feb 24, 2020
    Messages:
    57
    Likes Received:
    0
    Try "If player's balance is greater than 99:"
    --- Double Post Merged, Mar 19, 2020, Original Post Date: Mar 19, 2020 ---
    And instead of "Execute command "/eco take %player% 100" you can rather do "take 100 from player's balance"
     
  3. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    What addons do you have? Also try this:

    Code (Text):
    1. command /shop:
    2.     trigger:
    3.         open virtual chest inventory with size 3 named "&l&bShop" to player
    4.         format gui slot 10 of player with chest named "Box" with lore "100$" to run:
    5.             if player's money is greater than 99:
    6.                 remove 99 from player's balance
    7.                 give player 1 of chest named "Box"
    8.                 send "Successfully bought" to player
    9.                 close player's inventory
    10.             else:
    11.                 send "Get more money" to player
    12.         format gui slot 13 of player with 10 chest named "Box" with lore "900$" to run:
    13.             if player's money is greater than 899:
    14.                 remove 900 from player's balance
    15.                 give player 10 of chest named "Box"
    16.                 send "Successfully bought" to player
    17.                 close player's inventory
    18.             else:
    19.                 send "Get more money" to player
    20.         format gui slot 16 of player with 25 chest named "Box" with lore "2365$" to run:
    21.             if player's money is greater than 2364:
    22.                 remove 2365 from player's balance
    23.                 give player 25 of chest named "Box"
    24.                 send "Successfully bought" to player
    25.                 close player's inventory
    26.             else:
    27.                 send "Get more money" to player
     
  4. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    It didn't work and i have Skquery, Skvault, TuSke, Skellet, Skrayfall. I don't know about my skript version since im using minehut
     
  5. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Now im not 100% sure about this or not, but, you might need vault? Im not sure what SkVault does. I never had it. But i have vault on my server, and the code works just fine. No errors, and gives me the correct stuff. :emoji_slight_smile: Unless there is a addon you are missing.
     
  6. Potato

    Potato Active Member

    Joined:
    Feb 24, 2020
    Messages:
    57
    Likes Received:
    0
    YaPotato Try to add messages to see where the code stops
     
  7. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    I have vault installed
     
  8. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    I would debug it then. See what line isnt working.
     
  9. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    It stops after "if player's money is greater than 99:"
     
  10. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    Not sure if this will fix it. But try this:
    Code (Text):
    1. if player's balance is greater than 99:
     
  11. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    still doesn't work. Can you write yours skript plugins
     
  12. Mattllama987

    Mattllama987 Active Member

    Joined:
    Aug 5, 2018
    Messages:
    225
    Likes Received:
    7
    I have Tuske, Skrip-Mirror, Skellet, SkQurry and SkRayFalls
     
  13. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    Minehut doesn't have Skript-mirror.
     
  14. egamer3000

    egamer3000 Member

    Joined:
    Nov 25, 2019
    Messages:
    41
    Likes Received:
    8
    take (int) from player's balance
    should work on MH, you have Essentials?

    Oh, and, also, /ver skript.

    Minehut runs 2.4.1, I think.
     
  15. YaPotato

    YaPotato Member

    Joined:
    Mar 19, 2020
    Messages:
    11
    Likes Received:
    0
    I have essentials. the "If player's balance is greater than 99:" is the problem
     
Thread Status:
Not open for further replies.

Share This Page

Loading...