Solved Skript, remove items from players inventories

  • 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 community!

    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.

GougouLeVrai

Member
Nov 6, 2022
2
0
1
France
Code:
command /upgrade stone <int> [<player>]:
  permission: duocraft.upgrade
  permission message: "&c[DuoCraft] You don't have permission"
  aliases: message
  trigger:
    if arg-1 is 1:
      set {nbr1} to 2
      set {need1} to flint
      set {word1} to "Flint"
      set {nbr2} to 2
      set {need2} to stick
      set {word2} to "Stick"
    if arg-1 is 2:
      set {nbr1} to 16
      set {need1} to cobblestone
      set {word1} to "Cobblestones"
      set {nbr2} to 1
      set {need2} to plank
      set {word2} to "Plank"
    if arg-2's inventory contains "%{nbr1}% of %{need1}%":
      if arg-2's inventory contains  "%{nbr2}% of %{need2}%":
        remove {nbr1} of {need1} from arg-2's inventory
        remove {nbr2} of {need2} from arg-2's inventory
        set {_n} to nbt compound from "{Unbreakable:1,EntityTag:{Invisible:1b},HideFlags:23}"
        give wooden pickaxe with nbt {_n} named "&7&lLevel 1 - Stone pickaxe" to arg-2
      else:
        send "&cYou don't have enough %{word2}%" to arg-2
    else:
      send "&cYou don't have enough %{word1}%" to arg-2
Hey, I do this code, when I reload it everything works but when I try it nothing works. What's the problem please ?
[doublepost=1667781002,1667778340][/doublepost]Ok nevermind, I find issues
 
Status
Not open for further replies.