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.

How can I get a number of Items on player inventory

Discussion in 'Skript' started by Aztron, Jul 11, 2018.

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

    Aztron New Member

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

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    220
    Try something like this
    Code (Skript):
    1. command /blocks:
    2.     trigger:
    3.         set {_paper} to paper named "&bVoucherBlocks" with lore "&55Claim_Blocks"
    4.         if player has 1 of {_paper}:
    5.             set {_items} to the amount of {_paper} in inventory of player
    6.             set {_amount} to the amount of {_paper} in inventory of player * 5
    7.             remove {_items} of {_paper} from inventory of player
    8.             make console execute command "/acb %player% %{_amount}%"
     
Thread Status:
Not open for further replies.

Share This Page

Loading...