Help With Inventory Click

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

TheBiGuy

New Member
Oct 14, 2022
5
0
1
15
Hey! So im making a gui but im having a issue with the "on inventory click:"

When A Player Clicks There Own Inventory It Also Counts But I Only Want It To Count For The Gui
Does Anyone Know How To Do This?
Also Please Dont Judge My Gui lol [lookin at you shane]

Code:
command /blockshop:
    trigger:   
        open chest inventory with 6 rows named "&8Shop &7> &aBlocks" to player
        set slot 0 of player's current inventory to grass block named "<##5ad0e8>64x Grass Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 1 of player's current inventory to dirt named "<##5ad0e8>64x Dirt" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 2 of player's current inventory to cobblestone named "<##5ad0e8>64x Cobblestone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 3 of player's current inventory to stone named "<##5ad0e8>64x" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 4 of player's current inventory to smooth stone named "<##5ad0e8>64x Smooth Stone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 5 of player's current inventory to granite named "<##5ad0e8>64x Granite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 6 of player's current inventory to polished granite named "<##5ad0e8>64x Polished Granite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 7 of player's current inventory to diorite named "<##5ad0e8>64x Diorite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 8 of player's current inventory to polished diorite named "<##5ad0e8>64x Polished Diorite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 9 of player's current inventory to andesite named "<##5ad0e8>64x Andesite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 10 of player's current inventory to polished andesite named "<##5ad0e8>64x Polished Andesite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 11 of player's current inventory to cobbled deepslate named "<##5ad0e8>64x Cobbled Deepslate" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 12 of player's current inventory to deepslate named "<##5ad0e8>64x Deepslate" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 13 of player's current inventory to calcite named "<##5ad0e8>64x Calcite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 14 of player's current inventory to tuff named "<##5ad0e8>64x Tuff" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 15 of player's current inventory to oak log named "<##5ad0e8>64x Oak Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 16 of player's current inventory to birch log named "<##5ad0e8>64x Birch Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 17 of player's current inventory to spruce log named "<##5ad0e8>64x Spruce Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 18 of player's current inventory to jungle log named "<##5ad0e8>64x Jungle Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 19 of player's current inventory to acacia log named "<##5ad0e8>64x Acacia Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 20 of player's current inventory to dark oak log named "<##5ad0e8>64x Dark Oak Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 21 of player's current inventory to crimson stem named "<##5ad0e8>64x Crimson Stem" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 22 of player's current inventory to warped stem named "<##5ad0e8>64x Warped Stem" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 23 of player's current inventory to sand named "<##5ad0e8>64x Sand" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 24 of player's current inventory to sandstone named "<##5ad0e8>64x Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 25 of player's current inventory to smooth sandstone named "<##5ad0e8>64x Smooth Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 26 of player's current inventory to chiseled sandstone named "<##5ad0e8>64x Chisled Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 27 of player's current inventory to red sand named "<##5ad0e8>64x Red Sand" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"     
        set slot 28 of player's current inventory to red sandstone named "<##5ad0e8>64x Red Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 29 of player's current inventory to smooth red sandstone named "<##5ad0e8>64x Smooth Red Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 30 of player's current inventory to gravel named "<##5ad0e8>64x Gravel" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 31 of player's current inventory to crimson nylium named "<##5ad0e8>64x Crimson Nylium" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 32 of player's current inventory to warped nylium named "<##5ad0e8>64x Warped Nylium" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 33 of player's current inventory to quartz block named "<##5ad0e8>64x Quartz Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 34 of player's current inventory to dripstone block named "<##5ad0e8>64x Dripstone Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"           
        set slot 35 of player's current inventory to block of amethyst named "<##5ad0e8>64x Amethyst Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slots (integers between 36 and 44) of player's current inventory to gray glass pane named "&7"
        set slot 49 of player's current inventory to barrier named "<##fb0000>&lR<##e70303>&le<##d40606>&lt<##c00808>&lu<##ad0b0b>&lr<##990e0e>&ln"

on chest inventory click:
    if name of event-inventory is "&8Shop &7> &aBlocks":
        cancel event 
        if clicked slot = 0:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 grass block
                send "<##1ae03b>Bought 64 Grass Block For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player   
        if clicked slot = 1:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 dirt
                send "<##1ae03b>Bought 64 Dirt For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 2:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 cobblestone
                send "<##1ae03b>Bought 64 Cobblestone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 3:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 Stone
                send "<##1ae03b>Bought 64 Stone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 4:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 smooth stone
                send "<##1ae03b>Bought 64 Smooth Stone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 5:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 granite
                send "<##1ae03b>Bought 64 Granite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 6:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished granite
                send "<##1ae03b>Bought 64 Polished Granite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 7:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 Diorite
                send "<##1ae03b>Bought 64 Diorite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player   
        if clicked slot = 8:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished diorite
                send "<##1ae03b>Bought 64 Polished Diorite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 9:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 andesite
                send "<##1ae03b>Bought 64 Andesite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 10:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished andesite
                send "<##1ae03b>Bought 64 Polished Andesite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 11:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 cobbled deepslate
                send "<##1ae03b>Bought 64 Cobbled Deepslate For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 12:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 deepslate
                send "<##1ae03b>Bought Deepslate For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 13:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 calcite
                send "<##1ae03b>Bought 64 Calcite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 14:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 tuff
                send "<##1ae03b>Bought 64 Tuff For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 15:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 oak log
                send "<##1ae03b>Bought 64 Oak Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 16:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 birch log
                send "<##1ae03b>Bought 64 Birch Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 17:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 spruce log
                send "<##1ae03b>Bought 64 Spruce Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 18:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 jungle log
                send "<##1ae03b>Bought 64 Jungle Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 19:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 acacia log
                send "<##1ae03b>Bought 64 Acacia Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player   
        if clicked slot = 20:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 dark oak log
                send "<##1ae03b>Bought 64 Dark Oak Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 21:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 crimson stem
                send "<##1ae03b>Bought 64 Crimson Stems For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 22:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 warped stem
                send "<##1ae03b>Bought 64 Warped Stems For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 23:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 sand
                send "<##1ae03b>Bought 64 Sand For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 24:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 sandstone
                send "<##1ae03b>Bought Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player 
        if clicked slot = 25:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 smooth sandstone
                send "<##1ae03b>Bought 64 Smooth Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if clicked slot = 26:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 chiseled sandstone
                send "<##1ae03b>Bought 64 Chiseled Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
 
Code:
command /blockshop:
    trigger:
        set metadata tag "blockshop" of player to chest inventory with 6 rows named "&8Shop &7> &aBlocks"
        set slot 0 of metadata tag "blockshop" of player to grass block named "<##5ad0e8>64x Grass Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 1 of metadata tag "blockshop" of player to dirt named "<##5ad0e8>64x Dirt" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 2 of metadata tag "blockshop" of player to cobblestone named "<##5ad0e8>64x Cobblestone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 3 of metadata tag "blockshop" of player to stone named "<##5ad0e8>64x" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 4 of metadata tag "blockshop" of player to smooth stone named "<##5ad0e8>64x Smooth Stone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 5 of metadata tag "blockshop" of player to granite named "<##5ad0e8>64x Granite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 6 of metadata tag "blockshop" of player to polished granite named "<##5ad0e8>64x Polished Granite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 7 of metadata tag "blockshop" of player to diorite named "<##5ad0e8>64x Diorite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 8 of metadata tag "blockshop" of player to polished diorite named "<##5ad0e8>64x Polished Diorite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 9 of metadata tag "blockshop" of player to andesite named "<##5ad0e8>64x Andesite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 10 of metadata tag "blockshop" of player to polished andesite named "<##5ad0e8>64x Polished Andesite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 11 of metadata tag "blockshop" of player to cobbled deepslate named "<##5ad0e8>64x Cobbled Deepslate" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 12 of metadata tag "blockshop" of player to deepslate named "<##5ad0e8>64x Deepslate" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 13 of metadata tag "blockshop" of player to calcite named "<##5ad0e8>64x Calcite" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 14 of metadata tag "blockshop" of player to tuff named "<##5ad0e8>64x Tuff" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 15 of metadata tag "blockshop" of player to oak log named "<##5ad0e8>64x Oak Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 16 of metadata tag "blockshop" of player to birch log named "<##5ad0e8>64x Birch Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 17 of metadata tag "blockshop" of player to spruce log named "<##5ad0e8>64x Spruce Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 18 of metadata tag "blockshop" of player to jungle log named "<##5ad0e8>64x Jungle Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 19 of metadata tag "blockshop" of player to acacia log named "<##5ad0e8>64x Acacia Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 20 of metadata tag "blockshop" of player to dark oak log named "<##5ad0e8>64x Dark Oak Log" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 21 of metadata tag "blockshop" of player to crimson stem named "<##5ad0e8>64x Crimson Stem" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 22 of metadata tag "blockshop" of player to warped stem named "<##5ad0e8>64x Warped Stem" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 23 of metadata tag "blockshop" of player to sand named "<##5ad0e8>64x Sand" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 24 of metadata tag "blockshop" of player to sandstone named "<##5ad0e8>64x Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 25 of metadata tag "blockshop" of player to smooth sandstone named "<##5ad0e8>64x Smooth Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 26 of metadata tag "blockshop" of player to chiseled sandstone named "<##5ad0e8>64x Chisled Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 27 of metadata tag "blockshop" of player to red sand named "<##5ad0e8>64x Red Sand" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]" 
        set slot 28 of metadata tag "blockshop" of player to red sandstone named "<##5ad0e8>64x Red Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 29 of metadata tag "blockshop" of player to smooth red sandstone named "<##5ad0e8>64x Smooth Red Sandstone" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 30 of metadata tag "blockshop" of player to gravel named "<##5ad0e8>64x Gravel" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 31 of metadata tag "blockshop" of player to crimson nylium named "<##5ad0e8>64x Crimson Nylium" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 32 of metadata tag "blockshop" of player to warped nylium named "<##5ad0e8>64x Warped Nylium" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 33 of metadata tag "blockshop" of player to quartz block named "<##5ad0e8>64x Quartz Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slot 34 of metadata tag "blockshop" of player to dripstone block named "<##5ad0e8>64x Dripstone Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"       
        set slot 35 of metadata tag "blockshop" of player to block of amethyst named "<##5ad0e8>64x Amethyst Block" with lore "" and "&fBuy For: &a$16" and "" and "<##1ae03b>» [Click To Buy]"
        set slots (integers between 36 and 44) of metadata tag "blockshop" of player to gray glass pane named "&7"
        set slot 49 of metadata tag "blockshop" of player to barrier named "<##fb0000>&lR<##e70303>&le<##d40606>&lt<##c00808>&lu<##ad0b0b>&lr<##990e0e>&ln"
        open metadata tag "blockshop" of player to player

on inventory click:
    if event-inventory = metadata tag "blockshop" of player:
        cancel event
        if event-slot = 0:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 grass block
                send "<##1ae03b>Bought 64 Grass Block For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 1:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 dirt
                send "<##1ae03b>Bought 64 Dirt For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 2:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 cobblestone
                send "<##1ae03b>Bought 64 Cobblestone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 3:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 Stone
                send "<##1ae03b>Bought 64 Stone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 4:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 smooth stone
                send "<##1ae03b>Bought 64 Smooth Stone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 5:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 granite
                send "<##1ae03b>Bought 64 Granite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 6:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished granite
                send "<##1ae03b>Bought 64 Polished Granite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 7:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 Diorite
                send "<##1ae03b>Bought 64 Diorite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 8:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished diorite
                send "<##1ae03b>Bought 64 Polished Diorite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 9:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 andesite
                send "<##1ae03b>Bought 64 Andesite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 10:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 polished andesite
                send "<##1ae03b>Bought 64 Polished Andesite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 11:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 cobbled deepslate
                send "<##1ae03b>Bought 64 Cobbled Deepslate For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 12:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 deepslate
                send "<##1ae03b>Bought Deepslate For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 13:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 calcite
                send "<##1ae03b>Bought 64 Calcite For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 14:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 tuff
                send "<##1ae03b>Bought 64 Tuff For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 15:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 oak log
                send "<##1ae03b>Bought 64 Oak Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 16:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 birch log
                send "<##1ae03b>Bought 64 Birch Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 17:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 spruce log
                send "<##1ae03b>Bought 64 Spruce Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 18:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 jungle log
                send "<##1ae03b>Bought 64 Jungle Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 19:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 acacia log
                send "<##1ae03b>Bought 64 Acacia Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 20:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 dark oak log
                send "<##1ae03b>Bought 64 Dark Oak Logs For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 21:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 crimson stem
                send "<##1ae03b>Bought 64 Crimson Stems For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 22:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 warped stem
                send "<##1ae03b>Bought 64 Warped Stems For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 23:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 sand
                send "<##1ae03b>Bought 64 Sand For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 24:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 sandstone
                send "<##1ae03b>Bought Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 25:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 smooth sandstone
                send "<##1ae03b>Bought 64 Smooth Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
        if event-slot = 26:
            if {balance::%player's uuid%} > 16:
                remove 16 from {balance::%player's uuid%}
                give player 64 chiseled sandstone
                send "<##1ae03b>Bought 64 Chiseled Sandstone For &a$16"
            else:
                cancel event
                send "&cYou Do Not Have Enough Money!" to player
This should work. I've used metadata inventories (that's what I'm used to and it appears to be working for me) instead of chest inventories and inventory names . If you have any issues or concerns, reply or message me. Have a good day!
 
Last edited:
why metadata and not

set {_gui} to chest inventory
set slot 1 of {_gui} to stone
open {_gui} to player
[doublepost=1669462356,1669462263][/doublepost]metadata tag "blockshop" of player = {_gui}
 
Status
Not open for further replies.