I need to make a script that adds the command /sell, that will remove all items that have a specific lore and give you the correct amount of coins for each type of item.
So maybe stone could have a value of 1, but wood could have a value of 3.
So far I have made this code:
But it only removes one of the item from each stack, how can I change it so it sells all of them?
So maybe stone could have a value of 1, but wood could have a value of 3.
So far I have made this code:
Code:
command /sell:
permission: xwires.sell
permission message: &r&cYou don't have permission to use this command.
executable by: player
trigger:
loop all items in the inventory of player:
set {_l} to line 1 of lore of loop-item
if {_l} is set:
if {_l} contains "Lore Test":
remove 1 of loop-item from player's inventory