Solved Check if a player has a named item

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

ImKingGolden

Member
Aug 11, 2020
21
1
3
23
I tried looping the players inventory, and if player has a item named "&6Test" but nothing works any help would be great
Code:
if player has a stick named "&6Fishing Rod Handle":
                    send "&eTest" to player
 
I tried looping the players inventory, and if player has a item named "&6Test" but nothing works any help would be great
Code:
if player has a stick named "&6Fishing Rod Handle":
                    send "&eTest" to player
Code:
command /check <player>:
  trigger:
    if player has stick named "&6Fishing Rod Handle":
      broadcast "yes"
 
Try
Code:
if amount of stick named "&6Fishing Rod Handle" in player's inventory is more than 0:
or
Code:
set {_item} to stick named "&6Fishing Rod Handle"
if amount of {_item} in player's inventory is more than 0:
 
  • Like
Reactions: ImKingGolden
Didn't work thanks for the help though
I tested this on my server and it works just fine. Make sure the name matches perfectly. Also what version of script are you using?
[doublepost=1626312303,1626288700][/doublepost]
I tried looping the players inventory, and if player has a item named "&6Test" but nothing works any help would be great
Code:
if player has a stick named "&6Fishing Rod Handle":
                    send "&eTest" to player
This works for me with no addons: Skript version 2.6-beta2

Code:
command /check <player>:
  trigger:
    set arg-1's tool to 1 stick named "&6Fishing Rod Handle"
    if arg-1 has stick named "&6Fishing Rod Handle":
      broadcast "yes"
 
  • Like
Reactions: ImKingGolden
Status
Not open for further replies.