Remove arg-1 from player

Discussion in 'Skript' started by Stoian, Jan 29, 2020.

Thread Status:
Not open for further replies.
  1. Hello, I have a problem:
    Code (Text):
    on right click:
        if player's tool is a paper:
            if name of player's tool is "§6§lNasti§f§lCraft §e§lTokens":
                remove arg-1 from player's inventory
    Works until remove arg-1 from player's inventory...I want to take paper from player, and give him points
    as it was taken, how to do it? If player has 10 paper, give him 10 points. I use PlayerPoints, I know how to give him.
     
  2. there are no arguments in events
     
  3. Well the PlayerInteractEvent returns an ItemStack so you could get the amount in the itemstack and then use Player#getInventory().remove and pass the ItemStack
     
  4. yes, thats I asking for, how to do it?
     
  5. Code (Text):
    on right click:
        if player's tool is a paper:
            if name of player's tool is "§6§lNasti§f§lCraft §e§lTokens":
                set {_amount} to item amount of player's tool
                #draft code: [give {_amount} of player points to player]
                set player's tool to air
     
    • Agree Agree x 1
  6. So many thanks, but now I have another problem: make console execute command: "/points give %player% {_amount} and don't work. I use PlayerPoints, how to fix?
    make console execute command "/points give %player% %{_amount}%"
     
  7. dont forget to leave a positive rating for the spoonfeed please :D
     
    • Useful Useful x 1
Thread Status:
Not open for further replies.