Solved help with loop of players inventory

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

Tanner

New Member
Mar 30, 2020
5
0
0
25
So the code below is meant to check if the player is wearing the correct armor (which is does properly) then again check if the player is still wearing that armor every 5 seconds (just for testing purposes for now) the problem is that it does detect that the player has taken the armor of. The only solution I have come up with is checking to see if the player equips a new set (which I dont want at all). So any help is greatly appreciated! thanks!

And I cant use on equip because I am on minehut and physically cant get the correct skript addons.

command /set:
description: check for player set
trigger:
loop slots (integers from 36 to 39) of player's inventory:
if loop-value is any leather armor:
if lore of loop-value starts with "&e[&fCommon&e]":
add 1 to {_set1}

while {_set1} = 4:
send "test"
wait 5 seconds
loop slots (integers from 36 to 39) of player's inventory:
broadcast "%loop-value%"
if slots (integers from 36 to 39) of player's inventory are empty": #this is the problem line, the skript is loading with no errors but it is not stopping the loop when I take the armor off.
remove 4 from {_set1}
send "removing"
if {_set1} is less than 4:
send "stop"
stop loop
 
try this line
Code:
if slots (integers between 36 and 39) of player's inventory are air:
 
try this line
Code:
if slots (integers between 36 and 39) of player's inventory are air:
Thanks for the reply, but I ended up finding another method which works as well!

if helmet of player is air
add -4 to {_set1}
wait 1 tick
send "&c&lYou took your helmet off, removing set effects!"
 
Status
Not open for further replies.