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.

Skript Command Not Working

Discussion in 'Skript' started by nKn0wn, Jan 10, 2022.

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

    nKn0wn Member

    Joined:
    Jan 9, 2022
    Messages:
    2
    Likes Received:
    0
    Hey peoples. So I'm testing out making shop GUI's using skript 2.6, I am on 1.18.1, and don't have TuSke or any other skript addons (except skript of course, so I am doing vanilla skript). For some reason the command I have made will not work, I do /sk reload, and no errors, I look in the command list, the command shows up, yet when I type out the command (/toolshop), nothing happens. Here is the skript: It is very long so I am sorry about that lol.

    command /toolshop:
    trigger:
    set metadata tag "ToolShop" of player to chest inventory with 5 rows named "&8&lTool Shop"
    set slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 25, 26, 27, 28, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 of metadata tag "ToolShop" of player to black stained glass pane named "&0"
    set slot 11 of metadata tag "ToolShop" of player to wooden pickaxe with name "<##964B00>&lWooden Pickaxe" with lore "&7Click to purchase, costs 1 &b&ldiamond"
    set slot 12 of metadata tag "ToolShop" of player to stone pickaxe with name "&7&lStone Pickaxe" with lore "&7Click to purchase, costs 2 &b&ldiamonds"
    set slot 13 of metadata tag "ToolShop" of player to iron pickaxe with name "&f&liron Pickaxe" with lore "&7Click to purchase, costs 3 &b&ldiamonds"
    set slot 14 of metadata tag "ToolShop" of player to diamond pickaxe with name "&b&lDiamond Pickaxe" with lore "&7Click to purchase, costs 5 &b&ldiamonds"
    set slot 15 of metadata tag "ToolShop" of player to netherite pickaxe with name "&8&lNetherite Pickaxe" with lore "&7Click to purchase, costs 15 &b&ldiamonds"

    set slot 20 of metadata tag "ToolShop" of player to wooden axe with name "<##964B00>&lWooden axe" with lore "&7Click to purchase, costs 1 &b&ldiamond"
    set slot 21 of metadata tag "ToolShop" of player to stone axe with name "&7&lStone axe" with lore "&7Click to purchase, costs 2 &b&ldiamonds"
    set slot 22 of metadata tag "ToolShop" of player to iron axe with name "&f&liron axe" with lore "&7Click to purchase, costs 3 &b&ldiamonds"
    set slot 23 of metadata tag "ToolShop" of player to diamond axe with name "&b&lDiamond axe" with lore "&7Click to purchase, costs 5 &b&ldiamonds"
    set slot 24 of metadata tag "ToolShop" of player to netherite axe with name "&8&lNetherite axe" with lore "&7Click to purchase, costs 15 &b&ldiamonds"
    set slot 29 of metadata tag "ToolShop" of player to wooden shovel with name "<##964B00>&lWooden Shovel" with lore "&7Click to purchase, costs 1 &b&ldiamond"
    set slot 30 of metadata tag "ToolShop" of player to stone shovel with name "&7&lStone Shovel" with lore "&7Click to purchase, costs 2 &b&ldiamonds"
    set slot 31 of metadata tag "ToolShop" of player to iron shovel with name "&f&liron Shovel" with lore "&7Click to purchase, costs 3 &b&ldiamonds"
    set slot 32 of metadata tag "ToolShop" of player to diamond shovel with name "&b&lDiamondShovel" with lore "&7Click to purchase, costs 5 &b&ldiamonds"
    set slot 33 of metadata tag "ToolShop" of player to netherite shovel with name "&8&lNetherite Shovel" with lore "&7Click to purchase, costs 15 &b&ldiamonds"
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 11:
    If player's inventory contains 1 of diamond:
    remove 1 diamond from the player
    give 1 wooden pickaxe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 12:
    If player's inventory contains 2 of diamond:
    remove 2 diamond from the player
    give 1 stone pickaxe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 13:
    If player's inventory contains 3 of diamond:
    remove 3 diamond from the player
    give 1 iron pickaxe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 14:
    If player's inventory contains 5 of diamond:
    remove 5 diamond from the player
    give 1 diamond pickaxe to the player
    else:
    cancel event

    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 15:
    If player's inventory contains 15 of diamond:
    remove 15 diamond from the player
    give 1 netherite pickaxe to the player
    else:
    cancel event
    # -----------------------------------------------------------
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 20:
    If player's inventory contains 1 of diamond:
    remove 1 diamond from the player
    give 1 wooden axe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 21:
    If player's inventory contains 2 of diamond:
    remove 2 diamond from the player
    give 1 stone axe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 22:
    If player's inventory contains 3 of diamond:
    remove 3 diamond from the player
    give 1 iron axe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 23:
    If player's inventory contains 5 of diamond:
    remove 5 diamond from the player
    give 1 diamond axe to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 24:
    If player's inventory contains 15 of diamond:
    remove 15 diamond from the player
    give 1 netherite axe to the player
    else:
    cancel event
    # -----------------------------------------------------------
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 29:
    If player's inventory contains 1 of diamond:
    remove 1 diamond from the player
    give 1 wooden shovel to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 30:
    If player's inventory contains 2 of diamond:
    remove 2 diamond from the player
    give 1 stone shovel to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 31:
    If player's inventory contains 3 of diamond:
    remove 3 diamond from the player
    give 1 iron shovel to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 32:
    If player's inventory contains 5 of diamond:
    remove 5 diamond from the player
    give 1 diamond shovel to the player
    else:
    cancel event
    on inventory click:
    if event-inventory = (metadata tag "ToolShop" of player):
    cancel event
    if index of event-slot is 33:
    If player's inventory contains 15 of diamond:
    remove 15 diamond from the player
    give 1 netherite shovel to the player
    else:
    cancel event
     
  2. IlanBirn

    IlanBirn Member

    Joined:
    Jan 4, 2022
    Messages:
    4
    Likes Received:
    0
    i see some problems, you need to do:

    Code (Text):
    1.  
    2. loop player's inventory:
    3.     if loop-value is contained with 15 diamonds:
    4.         #my code is probably not right. try searching it or something
    5.  
     
  3. _PAPER_PLANE_

    _PAPER_PLANE_ Member

    Joined:
    Jan 21, 2022
    Messages:
    1
    Likes Received:
    0
    I also have this situation, but I found that as long as the item with the metadata tag will disappear
     
Thread Status:
Not open for further replies.

Share This Page

Loading...