#loop player's inventory

1 messages · Page 1 of 1 (latest)

vale rover
#

why are you stopping the loop after 1 interation of the loop

sturdy edge
#

Adding these 2 stop loop it resolved, but now it works only in My Main account, in any other not

vale rover
#

what

sturdy edge
#

Yeah try this without stopping and it Will not work

sturdy edge
#

having "test" item in inventory i got this:
also it removes 1 from inventory

#

command /test: trigger: wait 0.1 seconds loop all items in the player's inventory: if name of loop-item is "test": remove 1 of loop-item from player's inventory else: send "you don't have test item"

vale rover
#

yeah uh no

#

it works fine

sturdy edge
#

no because i want to send to player that he requires that item

#

i doing a check if player has the item to enter a certain zone

#

and if he does not have it, send a msg what he requires

vale rover
#

and it does do that

sturdy edge
vale rover
#

it was a dirt named "test"

#

and it was removed

sturdy edge
#

and what are those previous messages?

vale rover
#

the failed loops

#

no loop is going to immediately get you what you want

sturdy edge
#

is there a way to prevent that?

vale rover
#

if your goal is a specific item, just check if player's inventory contains (item)

#

is there a way to prevent a linear sequence?

#

beyond this, no

vale rover
#

a loop is a loop

#

nothing is going to change that

sturdy edge
#

but how is it possible that the first code works for me (but only for me)?

vale rover
#

it doesn't

#

i don't know what else to tell you

sturdy edge
#

so there is no other way to avoid this...