How can I get a number of Items on player inventory

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

Aztron

New Member
Mar 15, 2017
7
0
0
29
How can I make it work?
help please!
Sorry for my bad English
code_language.skript:
command /blocks:
  trigger:
    if player has 1 paper named "&bVoucherBlocks" with lore "&55Claim_Blocks":
      set {_items} to amount of paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" in player's inventory
      set {_amount} to amount of paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" in player's inventory *5
      remove {_items} paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" from player's inventory
      make console execute command "/acb %player% {_amount}"
-SkQuery 3.6.0 LIME
-Skript v2.2-dev36
 
How can I make it work?
help please!
Sorry for my bad English
code_language.skript:
command /blocks:
  trigger:
    if player has 1 paper named "&bVoucherBlocks" with lore "&55Claim_Blocks":
      set {_items} to amount of paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" in player's inventory
      set {_amount} to amount of paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" in player's inventory *5
      remove {_items} paper named "&bVoucherBlocks" with lore "&55Claim_Blocks" from player's inventory
      make console execute command "/acb %player% {_amount}"
-SkQuery 3.6.0 LIME
-Skript v2.2-dev36

Try something like this
code_language.skript:
command /blocks:
    trigger:
        set {_paper} to paper named "&bVoucherBlocks" with lore "&55Claim_Blocks"
        if player has 1 of {_paper}:
            set {_items} to the amount of {_paper} in inventory of player
            set {_amount} to the amount of {_paper} in inventory of player * 5
            remove {_items} of {_paper} from inventory of player
            make console execute command "/acb %player% %{_amount}%"
 
Status
Not open for further replies.