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.

Help With Inventory Click

Discussion in 'Skript' started by TheBiGuy, Nov 6, 2022.

Tags:
Thread Status:
Not open for further replies.
  1. TheBiGuy

    TheBiGuy New Member

    Joined:
    Oct 14, 2022
    Messages:
    5
    Likes Received:
    0
    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 (Text):
    1. command /blockshop:
    2.     trigger:  
    3.         open chest inventory with 6 rows named "&8Shop &7> &aBlocks" to player
    4.         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]"
    5.         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]"
    6.         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]"
    7.         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]"
    8.         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]"
    9.         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]"
    10.         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]"
    11.         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]"
    12.         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]"
    13.         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]"
    14.         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]"
    15.         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]"
    16.         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]"
    17.         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]"
    18.         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]"
    19.         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]"
    20.         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]"
    21.         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]"
    22.         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]"
    23.         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]"
    24.         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]"
    25.         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]"
    26.         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]"
    27.         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]"
    28.         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]"
    29.         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]"
    30.         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]"
    31.         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]"    
    32.         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]"
    33.         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]"
    34.         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]"
    35.         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]"
    36.         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]"
    37.         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]"
    38.         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]"          
    39.         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]"
    40.         set slots (integers between 36 and 44) of player's current inventory to gray glass pane named "&7"
    41.         set slot 49 of player's current inventory to barrier named "<##fb0000>&lR<##e70303>&le<##d40606>&lt<##c00808>&lu<##ad0b0b>&lr<##990e0e>&ln"
    42.  
    43. on chest inventory click:
    44.     if name of event-inventory is "&8Shop &7> &aBlocks":
    45.         cancel event
    46.         if clicked slot = 0:
    47.             if {balance::%player's uuid%} > 16:
    48.                 remove 16 from {balance::%player's uuid%}
    49.                 give player 64 grass block
    50.                 send "<##1ae03b>Bought 64 Grass Block For &a$16"
    51.             else:
    52.                 cancel event
    53.                 send "&cYou Do Not Have Enough Money!" to player  
    54.         if clicked slot = 1:
    55.             if {balance::%player's uuid%} > 16:
    56.                 remove 16 from {balance::%player's uuid%}
    57.                 give player 64 dirt
    58.                 send "<##1ae03b>Bought 64 Dirt For &a$16"
    59.             else:
    60.                 cancel event
    61.                 send "&cYou Do Not Have Enough Money!" to player
    62.         if clicked slot = 2:
    63.             if {balance::%player's uuid%} > 16:
    64.                 remove 16 from {balance::%player's uuid%}
    65.                 give player 64 cobblestone
    66.                 send "<##1ae03b>Bought 64 Cobblestone For &a$16"
    67.             else:
    68.                 cancel event
    69.                 send "&cYou Do Not Have Enough Money!" to player
    70.         if clicked slot = 3:
    71.             if {balance::%player's uuid%} > 16:
    72.                 remove 16 from {balance::%player's uuid%}
    73.                 give player 64 Stone
    74.                 send "<##1ae03b>Bought 64 Stone For &a$16"
    75.             else:
    76.                 cancel event
    77.                 send "&cYou Do Not Have Enough Money!" to player
    78.         if clicked slot = 4:
    79.             if {balance::%player's uuid%} > 16:
    80.                 remove 16 from {balance::%player's uuid%}
    81.                 give player 64 smooth stone
    82.                 send "<##1ae03b>Bought 64 Smooth Stone For &a$16"
    83.             else:
    84.                 cancel event
    85.                 send "&cYou Do Not Have Enough Money!" to player
    86.         if clicked slot = 5:
    87.             if {balance::%player's uuid%} > 16:
    88.                 remove 16 from {balance::%player's uuid%}
    89.                 give player 64 granite
    90.                 send "<##1ae03b>Bought 64 Granite For &a$16"
    91.             else:
    92.                 cancel event
    93.                 send "&cYou Do Not Have Enough Money!" to player
    94.         if clicked slot = 6:
    95.             if {balance::%player's uuid%} > 16:
    96.                 remove 16 from {balance::%player's uuid%}
    97.                 give player 64 polished granite
    98.                 send "<##1ae03b>Bought 64 Polished Granite For &a$16"
    99.             else:
    100.                 cancel event
    101.                 send "&cYou Do Not Have Enough Money!" to player
    102.         if clicked slot = 7:
    103.             if {balance::%player's uuid%} > 16:
    104.                 remove 16 from {balance::%player's uuid%}
    105.                 give player 64 Diorite
    106.                 send "<##1ae03b>Bought 64 Diorite For &a$16"
    107.             else:
    108.                 cancel event
    109.                 send "&cYou Do Not Have Enough Money!" to player  
    110.         if clicked slot = 8:
    111.             if {balance::%player's uuid%} > 16:
    112.                 remove 16 from {balance::%player's uuid%}
    113.                 give player 64 polished diorite
    114.                 send "<##1ae03b>Bought 64 Polished Diorite For &a$16"
    115.             else:
    116.                 cancel event
    117.                 send "&cYou Do Not Have Enough Money!" to player
    118.         if clicked slot = 9:
    119.             if {balance::%player's uuid%} > 16:
    120.                 remove 16 from {balance::%player's uuid%}
    121.                 give player 64 andesite
    122.                 send "<##1ae03b>Bought 64 Andesite For &a$16"
    123.             else:
    124.                 cancel event
    125.                 send "&cYou Do Not Have Enough Money!" to player
    126.         if clicked slot = 10:
    127.             if {balance::%player's uuid%} > 16:
    128.                 remove 16 from {balance::%player's uuid%}
    129.                 give player 64 polished andesite
    130.                 send "<##1ae03b>Bought 64 Polished Andesite For &a$16"
    131.             else:
    132.                 cancel event
    133.                 send "&cYou Do Not Have Enough Money!" to player
    134.         if clicked slot = 11:
    135.             if {balance::%player's uuid%} > 16:
    136.                 remove 16 from {balance::%player's uuid%}
    137.                 give player 64 cobbled deepslate
    138.                 send "<##1ae03b>Bought 64 Cobbled Deepslate For &a$16"
    139.             else:
    140.                 cancel event
    141.                 send "&cYou Do Not Have Enough Money!" to player
    142.         if clicked slot = 12:
    143.             if {balance::%player's uuid%} > 16:
    144.                 remove 16 from {balance::%player's uuid%}
    145.                 give player 64 deepslate
    146.                 send "<##1ae03b>Bought Deepslate For &a$16"
    147.             else:
    148.                 cancel event
    149.                 send "&cYou Do Not Have Enough Money!" to player
    150.         if clicked slot = 13:
    151.             if {balance::%player's uuid%} > 16:
    152.                 remove 16 from {balance::%player's uuid%}
    153.                 give player 64 calcite
    154.                 send "<##1ae03b>Bought 64 Calcite For &a$16"
    155.             else:
    156.                 cancel event
    157.                 send "&cYou Do Not Have Enough Money!" to player
    158.         if clicked slot = 14:
    159.             if {balance::%player's uuid%} > 16:
    160.                 remove 16 from {balance::%player's uuid%}
    161.                 give player 64 tuff
    162.                 send "<##1ae03b>Bought 64 Tuff For &a$16"
    163.             else:
    164.                 cancel event
    165.                 send "&cYou Do Not Have Enough Money!" to player
    166.         if clicked slot = 15:
    167.             if {balance::%player's uuid%} > 16:
    168.                 remove 16 from {balance::%player's uuid%}
    169.                 give player 64 oak log
    170.                 send "<##1ae03b>Bought 64 Oak Logs For &a$16"
    171.             else:
    172.                 cancel event
    173.                 send "&cYou Do Not Have Enough Money!" to player
    174.         if clicked slot = 16:
    175.             if {balance::%player's uuid%} > 16:
    176.                 remove 16 from {balance::%player's uuid%}
    177.                 give player 64 birch log
    178.                 send "<##1ae03b>Bought 64 Birch Logs For &a$16"
    179.             else:
    180.                 cancel event
    181.                 send "&cYou Do Not Have Enough Money!" to player
    182.         if clicked slot = 17:
    183.             if {balance::%player's uuid%} > 16:
    184.                 remove 16 from {balance::%player's uuid%}
    185.                 give player 64 spruce log
    186.                 send "<##1ae03b>Bought 64 Spruce Logs For &a$16"
    187.             else:
    188.                 cancel event
    189.                 send "&cYou Do Not Have Enough Money!" to player
    190.         if clicked slot = 18:
    191.             if {balance::%player's uuid%} > 16:
    192.                 remove 16 from {balance::%player's uuid%}
    193.                 give player 64 jungle log
    194.                 send "<##1ae03b>Bought 64 Jungle Logs For &a$16"
    195.             else:
    196.                 cancel event
    197.                 send "&cYou Do Not Have Enough Money!" to player
    198.         if clicked slot = 19:
    199.             if {balance::%player's uuid%} > 16:
    200.                 remove 16 from {balance::%player's uuid%}
    201.                 give player 64 acacia log
    202.                 send "<##1ae03b>Bought 64 Acacia Logs For &a$16"
    203.             else:
    204.                 cancel event
    205.                 send "&cYou Do Not Have Enough Money!" to player  
    206.         if clicked slot = 20:
    207.             if {balance::%player's uuid%} > 16:
    208.                 remove 16 from {balance::%player's uuid%}
    209.                 give player 64 dark oak log
    210.                 send "<##1ae03b>Bought 64 Dark Oak Logs For &a$16"
    211.             else:
    212.                 cancel event
    213.                 send "&cYou Do Not Have Enough Money!" to player
    214.         if clicked slot = 21:
    215.             if {balance::%player's uuid%} > 16:
    216.                 remove 16 from {balance::%player's uuid%}
    217.                 give player 64 crimson stem
    218.                 send "<##1ae03b>Bought 64 Crimson Stems For &a$16"
    219.             else:
    220.                 cancel event
    221.                 send "&cYou Do Not Have Enough Money!" to player
    222.         if clicked slot = 22:
    223.             if {balance::%player's uuid%} > 16:
    224.                 remove 16 from {balance::%player's uuid%}
    225.                 give player 64 warped stem
    226.                 send "<##1ae03b>Bought 64 Warped Stems For &a$16"
    227.             else:
    228.                 cancel event
    229.                 send "&cYou Do Not Have Enough Money!" to player
    230.         if clicked slot = 23:
    231.             if {balance::%player's uuid%} > 16:
    232.                 remove 16 from {balance::%player's uuid%}
    233.                 give player 64 sand
    234.                 send "<##1ae03b>Bought 64 Sand For &a$16"
    235.             else:
    236.                 cancel event
    237.                 send "&cYou Do Not Have Enough Money!" to player
    238.         if clicked slot = 24:
    239.             if {balance::%player's uuid%} > 16:
    240.                 remove 16 from {balance::%player's uuid%}
    241.                 give player 64 sandstone
    242.                 send "<##1ae03b>Bought Sandstone For &a$16"
    243.             else:
    244.                 cancel event
    245.                 send "&cYou Do Not Have Enough Money!" to player
    246.         if clicked slot = 25:
    247.             if {balance::%player's uuid%} > 16:
    248.                 remove 16 from {balance::%player's uuid%}
    249.                 give player 64 smooth sandstone
    250.                 send "<##1ae03b>Bought 64 Smooth Sandstone For &a$16"
    251.             else:
    252.                 cancel event
    253.                 send "&cYou Do Not Have Enough Money!" to player
    254.         if clicked slot = 26:
    255.             if {balance::%player's uuid%} > 16:
    256.                 remove 16 from {balance::%player's uuid%}
    257.                 give player 64 chiseled sandstone
    258.                 send "<##1ae03b>Bought 64 Chiseled Sandstone For &a$16"
    259.             else:
    260.                 cancel event
    261.                 send "&cYou Do Not Have Enough Money!" to player  
     
  2. foxyplush

    foxyplush Member

    Joined:
    Apr 25, 2022
    Messages:
    14
    Likes Received:
    1
    Code (Text):
    1. command /blockshop:
    2.     trigger:
    3.         set metadata tag "blockshop" of player to chest inventory with 6 rows named "&8Shop &7> &aBlocks"
    4.         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]"
    5.         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]"
    6.         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]"
    7.         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]"
    8.         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]"
    9.         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]"
    10.         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]"
    11.         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]"
    12.         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]"
    13.         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]"
    14.         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]"
    15.         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]"
    16.         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]"
    17.         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]"
    18.         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]"
    19.         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]"
    20.         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]"
    21.         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]"
    22.         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]"
    23.         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]"
    24.         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]"
    25.         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]"
    26.         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]"
    27.         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]"
    28.         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]"
    29.         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]"
    30.         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]"
    31.         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]"
    32.         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]"
    33.         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]"
    34.         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]"
    35.         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]"
    36.         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]"
    37.         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]"
    38.         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]"      
    39.         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]"
    40.         set slots (integers between 36 and 44) of metadata tag "blockshop" of player to gray glass pane named "&7"
    41.         set slot 49 of metadata tag "blockshop" of player to barrier named "<##fb0000>&lR<##e70303>&le<##d40606>&lt<##c00808>&lu<##ad0b0b>&lr<##990e0e>&ln"
    42.         open metadata tag "blockshop" of player to player
    43.  
    44. on inventory click:
    45.     if event-inventory = metadata tag "blockshop" of player:
    46.         cancel event
    47.         if event-slot = 0:
    48.             if {balance::%player's uuid%} > 16:
    49.                 remove 16 from {balance::%player's uuid%}
    50.                 give player 64 grass block
    51.                 send "<##1ae03b>Bought 64 Grass Block For &a$16"
    52.             else:
    53.                 cancel event
    54.                 send "&cYou Do Not Have Enough Money!" to player
    55.         if event-slot = 1:
    56.             if {balance::%player's uuid%} > 16:
    57.                 remove 16 from {balance::%player's uuid%}
    58.                 give player 64 dirt
    59.                 send "<##1ae03b>Bought 64 Dirt For &a$16"
    60.             else:
    61.                 cancel event
    62.                 send "&cYou Do Not Have Enough Money!" to player
    63.         if event-slot = 2:
    64.             if {balance::%player's uuid%} > 16:
    65.                 remove 16 from {balance::%player's uuid%}
    66.                 give player 64 cobblestone
    67.                 send "<##1ae03b>Bought 64 Cobblestone For &a$16"
    68.             else:
    69.                 cancel event
    70.                 send "&cYou Do Not Have Enough Money!" to player
    71.         if event-slot = 3:
    72.             if {balance::%player's uuid%} > 16:
    73.                 remove 16 from {balance::%player's uuid%}
    74.                 give player 64 Stone
    75.                 send "<##1ae03b>Bought 64 Stone For &a$16"
    76.             else:
    77.                 cancel event
    78.                 send "&cYou Do Not Have Enough Money!" to player
    79.         if event-slot = 4:
    80.             if {balance::%player's uuid%} > 16:
    81.                 remove 16 from {balance::%player's uuid%}
    82.                 give player 64 smooth stone
    83.                 send "<##1ae03b>Bought 64 Smooth Stone For &a$16"
    84.             else:
    85.                 cancel event
    86.                 send "&cYou Do Not Have Enough Money!" to player
    87.         if event-slot = 5:
    88.             if {balance::%player's uuid%} > 16:
    89.                 remove 16 from {balance::%player's uuid%}
    90.                 give player 64 granite
    91.                 send "<##1ae03b>Bought 64 Granite For &a$16"
    92.             else:
    93.                 cancel event
    94.                 send "&cYou Do Not Have Enough Money!" to player
    95.         if event-slot = 6:
    96.             if {balance::%player's uuid%} > 16:
    97.                 remove 16 from {balance::%player's uuid%}
    98.                 give player 64 polished granite
    99.                 send "<##1ae03b>Bought 64 Polished Granite For &a$16"
    100.             else:
    101.                 cancel event
    102.                 send "&cYou Do Not Have Enough Money!" to player
    103.         if event-slot = 7:
    104.             if {balance::%player's uuid%} > 16:
    105.                 remove 16 from {balance::%player's uuid%}
    106.                 give player 64 Diorite
    107.                 send "<##1ae03b>Bought 64 Diorite For &a$16"
    108.             else:
    109.                 cancel event
    110.                 send "&cYou Do Not Have Enough Money!" to player
    111.         if event-slot = 8:
    112.             if {balance::%player's uuid%} > 16:
    113.                 remove 16 from {balance::%player's uuid%}
    114.                 give player 64 polished diorite
    115.                 send "<##1ae03b>Bought 64 Polished Diorite For &a$16"
    116.             else:
    117.                 cancel event
    118.                 send "&cYou Do Not Have Enough Money!" to player
    119.         if event-slot = 9:
    120.             if {balance::%player's uuid%} > 16:
    121.                 remove 16 from {balance::%player's uuid%}
    122.                 give player 64 andesite
    123.                 send "<##1ae03b>Bought 64 Andesite For &a$16"
    124.             else:
    125.                 cancel event
    126.                 send "&cYou Do Not Have Enough Money!" to player
    127.         if event-slot = 10:
    128.             if {balance::%player's uuid%} > 16:
    129.                 remove 16 from {balance::%player's uuid%}
    130.                 give player 64 polished andesite
    131.                 send "<##1ae03b>Bought 64 Polished Andesite For &a$16"
    132.             else:
    133.                 cancel event
    134.                 send "&cYou Do Not Have Enough Money!" to player
    135.         if event-slot = 11:
    136.             if {balance::%player's uuid%} > 16:
    137.                 remove 16 from {balance::%player's uuid%}
    138.                 give player 64 cobbled deepslate
    139.                 send "<##1ae03b>Bought 64 Cobbled Deepslate For &a$16"
    140.             else:
    141.                 cancel event
    142.                 send "&cYou Do Not Have Enough Money!" to player
    143.         if event-slot = 12:
    144.             if {balance::%player's uuid%} > 16:
    145.                 remove 16 from {balance::%player's uuid%}
    146.                 give player 64 deepslate
    147.                 send "<##1ae03b>Bought Deepslate For &a$16"
    148.             else:
    149.                 cancel event
    150.                 send "&cYou Do Not Have Enough Money!" to player
    151.         if event-slot = 13:
    152.             if {balance::%player's uuid%} > 16:
    153.                 remove 16 from {balance::%player's uuid%}
    154.                 give player 64 calcite
    155.                 send "<##1ae03b>Bought 64 Calcite For &a$16"
    156.             else:
    157.                 cancel event
    158.                 send "&cYou Do Not Have Enough Money!" to player
    159.         if event-slot = 14:
    160.             if {balance::%player's uuid%} > 16:
    161.                 remove 16 from {balance::%player's uuid%}
    162.                 give player 64 tuff
    163.                 send "<##1ae03b>Bought 64 Tuff For &a$16"
    164.             else:
    165.                 cancel event
    166.                 send "&cYou Do Not Have Enough Money!" to player
    167.         if event-slot = 15:
    168.             if {balance::%player's uuid%} > 16:
    169.                 remove 16 from {balance::%player's uuid%}
    170.                 give player 64 oak log
    171.                 send "<##1ae03b>Bought 64 Oak Logs For &a$16"
    172.             else:
    173.                 cancel event
    174.                 send "&cYou Do Not Have Enough Money!" to player
    175.         if event-slot = 16:
    176.             if {balance::%player's uuid%} > 16:
    177.                 remove 16 from {balance::%player's uuid%}
    178.                 give player 64 birch log
    179.                 send "<##1ae03b>Bought 64 Birch Logs For &a$16"
    180.             else:
    181.                 cancel event
    182.                 send "&cYou Do Not Have Enough Money!" to player
    183.         if event-slot = 17:
    184.             if {balance::%player's uuid%} > 16:
    185.                 remove 16 from {balance::%player's uuid%}
    186.                 give player 64 spruce log
    187.                 send "<##1ae03b>Bought 64 Spruce Logs For &a$16"
    188.             else:
    189.                 cancel event
    190.                 send "&cYou Do Not Have Enough Money!" to player
    191.         if event-slot = 18:
    192.             if {balance::%player's uuid%} > 16:
    193.                 remove 16 from {balance::%player's uuid%}
    194.                 give player 64 jungle log
    195.                 send "<##1ae03b>Bought 64 Jungle Logs For &a$16"
    196.             else:
    197.                 cancel event
    198.                 send "&cYou Do Not Have Enough Money!" to player
    199.         if event-slot = 19:
    200.             if {balance::%player's uuid%} > 16:
    201.                 remove 16 from {balance::%player's uuid%}
    202.                 give player 64 acacia log
    203.                 send "<##1ae03b>Bought 64 Acacia Logs For &a$16"
    204.             else:
    205.                 cancel event
    206.                 send "&cYou Do Not Have Enough Money!" to player
    207.         if event-slot = 20:
    208.             if {balance::%player's uuid%} > 16:
    209.                 remove 16 from {balance::%player's uuid%}
    210.                 give player 64 dark oak log
    211.                 send "<##1ae03b>Bought 64 Dark Oak Logs For &a$16"
    212.             else:
    213.                 cancel event
    214.                 send "&cYou Do Not Have Enough Money!" to player
    215.         if event-slot = 21:
    216.             if {balance::%player's uuid%} > 16:
    217.                 remove 16 from {balance::%player's uuid%}
    218.                 give player 64 crimson stem
    219.                 send "<##1ae03b>Bought 64 Crimson Stems For &a$16"
    220.             else:
    221.                 cancel event
    222.                 send "&cYou Do Not Have Enough Money!" to player
    223.         if event-slot = 22:
    224.             if {balance::%player's uuid%} > 16:
    225.                 remove 16 from {balance::%player's uuid%}
    226.                 give player 64 warped stem
    227.                 send "<##1ae03b>Bought 64 Warped Stems For &a$16"
    228.             else:
    229.                 cancel event
    230.                 send "&cYou Do Not Have Enough Money!" to player
    231.         if event-slot = 23:
    232.             if {balance::%player's uuid%} > 16:
    233.                 remove 16 from {balance::%player's uuid%}
    234.                 give player 64 sand
    235.                 send "<##1ae03b>Bought 64 Sand For &a$16"
    236.             else:
    237.                 cancel event
    238.                 send "&cYou Do Not Have Enough Money!" to player
    239.         if event-slot = 24:
    240.             if {balance::%player's uuid%} > 16:
    241.                 remove 16 from {balance::%player's uuid%}
    242.                 give player 64 sandstone
    243.                 send "<##1ae03b>Bought Sandstone For &a$16"
    244.             else:
    245.                 cancel event
    246.                 send "&cYou Do Not Have Enough Money!" to player
    247.         if event-slot = 25:
    248.             if {balance::%player's uuid%} > 16:
    249.                 remove 16 from {balance::%player's uuid%}
    250.                 give player 64 smooth sandstone
    251.                 send "<##1ae03b>Bought 64 Smooth Sandstone For &a$16"
    252.             else:
    253.                 cancel event
    254.                 send "&cYou Do Not Have Enough Money!" to player
    255.         if event-slot = 26:
    256.             if {balance::%player's uuid%} > 16:
    257.                 remove 16 from {balance::%player's uuid%}
    258.                 give player 64 chiseled sandstone
    259.                 send "<##1ae03b>Bought 64 Chiseled Sandstone For &a$16"
    260.             else:
    261.                 cancel event
    262.                 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!
     
    #2 foxyplush, Nov 11, 2022
    Last edited: Nov 11, 2022
  3. Pierrelasse

    Pierrelasse Active Member

    Joined:
    Apr 20, 2022
    Messages:
    116
    Likes Received:
    4
    why metadata and not

    set {_gui} to chest inventory
    set slot 1 of {_gui} to stone
    open {_gui} to player
    --- Double Post Merged, Nov 26, 2022, Original Post Date: Nov 26, 2022 ---
    metadata tag "blockshop" of player = {_gui}
     
Thread Status:
Not open for further replies.

Share This Page

Loading...