I tried to create a /Sell all skript, and this is what my final result came into. But somehow it can't register if the player has the specific item(s)..
Code:
Options:
troutPRICE: 10.0
bfishPRICE: 7.0
tunaPRICE: 5.0
Command /Sell [<String>]:
trigger:
if arg-1 is "All":
if player has raw_fish with name "&7Trout" or clownfish with name "&7Butterfly Fish" or 349:1 with name "&7Tuna":
set {_Trout} to number of 349 named "&7Trout" in player's inventory
set {_Bfish} to number of clownfish named "&7Butterfly Fish" in player's inventory
set {_Tuna} to number of 349:1 named "&7Tuna" in player's inventory
loop {_trout} times
remove 1 raw fish named "&7Trout" from player's inventory
loop {_Bfish} times
remove 1 clownfish named "&7Butterfly Fish" from player's inventory
loop {_Tuna} times
remove 1 349:1 named "&7Tuna" from player's inventory
if {_trout} > 0:
set {_Trout1} to {_Trout} * {@troutPRICE}
if {_Bfish} > 0:
set {_Bfish1} to {_Bfish} * {@bfishPRICE}
if {Tuna} > 0:
set {_Tuna1} to {_Tuna} * {@tunaPRICE}
set {_Sum} to {_trout1} + {_Bfish1} + {_Tuna1}
Add {_Sum} to player's balance
send "&bYou sold all your fish for a total of &a%{_Sum}%&b!"
play "BLOCK_NOTE_PLING" to player
else:
send "&cYou have nothing to sell.."