Solved Help. Can't make player buy

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

YaPotato

Member
Mar 19, 2020
11
0
0
24
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
 
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

Try "If player's balance is greater than 99:"
[doublepost=1584646098,1584646047][/doublepost]And instead of "Execute command "/eco take %player% 100" you can rather do "take 100 from player's balance"
 
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
What addons do you have? Also try this:

Code:
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:
                remove 99 from player's balance
                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:
                remove 900 from player's balance
                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:
                remove 2365 from player's balance
                give player 25 of chest named "Box"
                send "Successfully bought" to player
                close player's inventory
            else:
                send "Get more money" to player
 
It didn't work and i have Skquery, Skvault, TuSke, Skellet, Skrayfall. I don't know about my skript version since im using minehut
 
It didn't work and i have Skquery, Skvault, TuSke, Skellet, Skrayfall. I don't know about my skript version since im using minehut
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.
 
Status
Not open for further replies.