variables:
{ironset::iron helmet} = 306
{ironset::iron chestplate} = 307
{ironset::iron leggings} = 308
{ironset::iron boots} = 309
{aS} = 35
on dispense:
loop {ironset::*}:
if loop-value is item:
cancel event
on rightclick:
checkArmours(player)
on inventory click:
checkArmours(player)
function checkArmours(p: player):
if {_p} has permission "wear.ironset":
stop
wait 2 tick
loop {ironset::*}:
loop 4 times:
if slot (loop-value-2)+{aS} of {_p} is loop-value-1:
add slot (loop-value-2)+{aS} of {_p} to {_p}
set slot (loop-value-2)+{aS} of {_p} to air
stop