Jump to content

My Shop Skript Pls Help!


SlimeFroster

Recommended Posts

command /ShopTest123:
    trigger:
        set {_gui} to a new chest inventory with 3 row with name "&6&lChoose The Shop!"
        set slot 11 of {_gui} to stone with name "&b&lBuyShop!"
        set slot 15 of {_gui} to grass with name "&2&lSellShop!"
        set slot 22 of {_gui} to barrier with name "&c&lExit."
        open {_gui} to player
 
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 11:
            close player's inventory
            wait 5 ticks
            set {_gui} to a new chest inventory with 5 row with name "&b&lBuyShop!"
            set slot 44 of {_gui} to barrier with name "&c&lExit"
            set slot 36 of {_gui} to barrier with name "&c&lExit"
            set slot 40 of {_gui} to paper with name "&f&lPage 0/1"
            open {_gui} to player
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 15:
            close player's inventory
            wait 5 ticks
            set {_gui} to a new chest inventory with 5 row with name "&2&lSellShop!"
            set slot 44 of {_gui} to barrier with name "&c&lExit"
            set slot 36 of {_gui} to barrier with name "&c&lExit"
            set slot 40 of {_gui} to paper with name "&7&lPage 0/1"
            set slot 0 of {_gui} to dirt with name "&2&l$0.1"
            open {_gui} to player
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 22:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 44:
            close player's inventory
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 44:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 36:
            close player's inventory
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 36:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 40:
            cancel event
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 40:
            cancel event
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 0:
            take 1 dirt from player's inventory                   # dosent understand event take 1 dirt from players inventory ( 2nd error )
            eco give %player% $0.1                                  # dosent give the money ( 1st error )
            send "&2&lShop | SuccessFully Gave You $0.1"
        else:
            send "&2&lShop | Get More Dirt!"
on inventory click:
    if name of event-inventory is "&2&lSellShop!":                     Please Help Me And fix It!
        if index of event-slot = 0:
            cancel event    
Edited by SlimeFroster
Link to comment
Share on other sites

Hey SlimeFroster! I believe I fixed your script! I added notes of what I changed to the areas where you added comments in the Skript! Please let me know if it doesn't work!

command /ShopTest123:
    trigger:
        set {_gui} to a new chest inventory with 3 row with name "&6&lChoose The Shop!"
        set slot 11 of {_gui} to stone with name "&b&lBuyShop!"
        set slot 15 of {_gui} to grass with name "&2&lSellShop!"
        set slot 22 of {_gui} to barrier with name "&c&lExit."
        open {_gui} to player
 
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 11:
            close player's inventory
            wait 5 ticks
            set {_gui} to a new chest inventory with 5 row with name "&b&lBuyShop!"
            set slot 44 of {_gui} to barrier with name "&c&lExit"
            set slot 36 of {_gui} to barrier with name "&c&lExit"
            set slot 40 of {_gui} to paper with name "&f&lPage 0/1"
            open {_gui} to player
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 15:
            close player's inventory
            wait 5 ticks
            set {_gui} to a new chest inventory with 5 row with name "&2&lSellShop!"
            set slot 44 of {_gui} to barrier with name "&c&lExit"
            set slot 36 of {_gui} to barrier with name "&c&lExit"
            set slot 40 of {_gui} to paper with name "&7&lPage 0/1"
            set slot 0 of {_gui} to dirt with name "&2&l$0.1"
            open {_gui} to player
on inventory click:
    if name of event-inventory is "&6&lChoose The Shop!":
        if index of event-slot = 22:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 44:
            close player's inventory
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 44:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 36:
            close player's inventory
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 36:
            close player's inventory
on inventory click:
    if name of event-inventory is "&b&lBuyShop!":
        if index of event-slot = 40:
            cancel event
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 40:
            cancel event
on inventory click:
    if name of event-inventory is "&2&lSellShop!":
        if index of event-slot = 0:
            if player has 1 dirt: #I added this line as before it just gave you money any time you clicked slot 0!        
                remove 1 dirt from player's inventory #Skript doesn't register 'take' as a deletion or removal action- Use 'Remove' or 'Delete' in the future!
                add 0.1 to money of player # Your issue here was that you used percentages when it wasn't necessary- As well you wrote it as you would when executing a command.
                send "&2&lShop | SuccessFully Gave You $0.1"
            else:
                send "&2&lShop | Get More Dirt!"
on inventory click:
    if name of event-inventory is "&2&lSellShop!":   #I believe I fixed everything you had!!
        if index of event-slot = 0:
            cancel event

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...