Player has ITEM named "---":

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

Potato

Active Member
Feb 24, 2020
57
1
0
Well, i got this skript that doesnt work. It reloads and says its working. I've tried everything that the skript says and i've tested what doesnt work. After "Player has ITEM named "---":" it doesnt work.. plz help.

Code:
function buyShop(p: Player, i: Text):
  if {_i} is "p1":
    if {Balance::%{_p}%} is higher than or equal to 500:
      {_p} has wooden pickaxe named "&7Pickaxe (1)":
        send "tes" to {_p}
        give {_p} 1 wooden_pickaxe named "&7Pickaxe (2)"
        send "&7Successfully purchased &6[1]" to {_p}
        remove 500 from {Balance::%{_p}%}
        remove 1 wooden_pickaxe named "&7Pickaxe (1)" from {_p}
 
Add debug messages to conditions prior to item checking
Sorry? I don't quite understand that..
[doublepost=1583182198,1583182164][/doublepost]
Add debug messages to conditions prior to item checking
There are no errors
[doublepost=1583182457][/doublepost]This is the whole skript:
Code:
Command /shop:
    trigger:
        shopMenu(player, "mainmenu")

function shopMenu(p: Player, t: Text):
  if {_t} is "mainmenu":
    open virtual chest inventory with 1 rows named "&6&lShop" to {_p}
    loop 9 times:
      format gui slot (loop-number - 1) of {_p} with gray stained glass pane named "&f" to do nothing
    format gui slot 1 of {_p} with Diamond pickaxe named "&e&oPickaxes" with lore "&7Buy Gear||&aClick to enter" to run function shopMenu({_p}, "pickaxes")

  if {_t} is "pickaxes":
    open virtual chest inventory with 3 rows named "&e&oPickaxes" to {_p}
    format gui slot 10 of {_p} with wooden pickaxe named "&7Pickaxe (1)" with lore "&eRequire: &7Starter Sword||&6&o500g||&aClick to buy" to run function buyShit({_p}, "p1")

function buyShop(p: Player, i: Text):
  if {_i} is "p1":
    if {Balance::%{_p}%} is higher than or equal to 500:
      {_p} has wooden pickaxe named "&7Pickaxe (1)":
        send "tes" to {_p}
        give {_p} 1 wooden_pickaxe named "&7Pickaxe (2)"
        send "&7Successfully purchased &6[1]" to {_p}
        remove 500 from {Balance::%{_p}%}
        remove 1 wooden_pickaxe named "&7Pickaxe (1)" from {_p}
 
Try this
Code:
if {_p}'s inventory has wooden pickaxe named "&7Pickaxe (1)":
 
Status
Not open for further replies.