code_language.skript:
command /sell:
trigger:
if player have diamond:
set {_i} to 0
set {_e} to 0
loop all items in the inventory of player:
if loop-item is diamond:
if loop-item's name is not set:
set {_c} to item amount of loop-item
add {_c} to {_i}
remove loop-item from player's inventory
add 30 to {_e}
if {_i} is 0:
send "you have no diamonds with no custom name."
stop
send "you have %{_i}% diamonds with no custom name."
send "you earned &6%{_e}% &fcoins."
add {_e} to {coins.%uuid of player%}
else:
send "you have no diamonds with no custom name."
if i execute /sell with only having diamonds with custom name, it says "you have no diamonds with no custom name." and do nothing.(working fine)
and if i execute /sell with only having diamonds without custom name, it says works fine.
but, if i run /sell with diamonds with custom name AND diamonds without custom name, it delete only 1 stack of any diamonds in faster slot.
ex) if i have diamond with custom name at slot 2, 4, and i have diamond without custom name at slot 12, it deletes only diamond at slot 2.
I want to make to delete only diamonds without custom name.
Thank you for reading long article..