#how to make it check if player does not have a (specific) item in their inventory

1 messages · Page 1 of 1 (latest)

eager cave
#

so i want to make a multiplier skript and i need to make it so if player has a item in their inventory the variable will be true, and if a player does not have the item then the variable will stay as false, and if you get the item and it turns true, the problem is when i always throw the item away or delete it from my inventory it will still stay true
here the code, pls someone help

on inventory open:
if event-inventory = {mul}:
if {multipickreq.%player%} = true:
if player's inventory doesent contain 1 stone:
set {multipickreq.%player%} to false
send "&cu got 0 stone :(" to player
if player's inventory contains 1 stone:
set {multipickreq.%player%} to true
send "&aYAY U GOT ATLEAST 1 STONE :D" to player

graceful talon
#

‘’’code’’’

graceful talon
eager cave
#

im trying to make it so if u open a gui the item inside it will tell u if you have specific item in your inventory, so X is no and check mark is yes, and i wanted to make it so if for example you need 64 stone in your inventory and when you get the 64 stone it will say for example "✅ stone x64" and if u like drop it or use it on something it will now say ":❌ stone x64". i need it like this

mystic tulip
mystic tulip
# eager cave so i want to make a multiplier skript and i need to make it so if player has a i...
  1. use code blocks to make your code and indentation easy to read
  • ```code here```
  1. Use list variables and UUIDs. Lists are much more versatile and capable than normal variables, and UUIDs are much better for long-term storage.
  • {multipickreq.%player%} -> {multipickreq::%player's UUID%}
  • Alternatively, as you only need this while the player is online, you could store this in a metadata tag that you set on join
  1. The other condition can just be else:

  2. "pls someone help"

  • You need to tell us what you need help with. In this case, I assume that you are having trouble with detecting when it enters/leaves an inventory.
  • Since you have no code for this, the first step is to always try somethingyourself first. Start with events like on death, on drop, on pick up, and on inventory close
eager cave
# eager cave im trying to make it so if u open a gui the item inside it will tell u if you ha...

im sorry you got it wrong. I meant if you have 64 stone in your inventory, when you for example do /multiplier and hover over a item (in this case its blue dye) then it will show "✅ stone x64" and now if you dont have 64 stone. it will say "❌ stone x64". so now the problem is i dont know how to make it so it detects if player does not have the requiring stone. I tried a few ways i looked in the skunity docs but i still couldnt find anything.

eager cave
#

that is the code

#

and now if player's inventory doesent contain 1 stone: is the problem

#

it doesent show any errors but it doesent work how i want it to be

mystic tulip
mystic tulip
eager cave
#

oh u need the full code?

mystic tulip
#

no

graceful talon