options:
autosell_items:
diamond:
display_name: "&bElmas"
price: 10
iron_ingot:
display_name: "&fDemir İngot"
price: 5
gold_ingot:
display_name: "&6Altın İngot"
price: 8
command /otosat [<text>]:
permission: otosat.use
trigger:
if arg-1 is not set:
send "&cKullanım: /otosat [aktif/pasif]"
else if arg-1 is "aktif":
set {autosell_enabled} of player to true
send "&aOtomatik satış özelliği etkinleştirildi."
else if arg-1 is "pasif":
set {autosell_enabled} of player to false
send "&aOtomatik satış özelliği devre dışı bırakıldı."
else:
send "&cGeçersiz argüman! Kullanım: /otosat [aktif/pasif]"
on player drop item:
if {autosell_enabled} of player is true:
loop all items in player's inventory:
if loop-item's name is not "Air":
set {_item} to loop-item
if {_item} is in keys of autosell_items:
set {_price} to value of {_item} in autosell_items
set {_amount} to loop-item's amount
if {_amount} > 0:
set {_total} to {_amount} * {_price}
give {_total} to player
remove {_amount} of loop-item from player
send "&a%{_amount}% %{display_name%}% %{_price}% fiyatından satıldı."