i want to make sell item based on lore
but the player will need to put item in chest so the item will be sold
i have this and its working but i just dont know how to multiply the item amount with the price
please help
[doublepost=1508070031,1508067945][/doublepost]why i cant use this code?
it say that i can only have one at most value
but the player will need to put item in chest so the item will be sold
i have this and its working but i just dont know how to multiply the item amount with the price
please help
code_language.skript:
variables:
{sellprice.%player%.tprice} = 0
command /tes:
trigger:
open chest with 3 rows named "&aShop" to player
set {_slo} to 0
loop 27 times:
set slot {_slo} of player's current inventory to glass named "&bShift Click the item"
add 1 to {_slo}
set {_sloz} to 9
loop 9 times:
set slot {_sloz} of player's current inventory to air
add 1 to {_sloz}
set slot 22 of player's current inventory to diamond named "&cSell" with lore "&bPrice: %{sellprice.%player%.tprice}% ||&bbalance: %player's balance%"
on store:
set {_store::*} to lore of event-item split at "||"
loop {_store::*}:
if "%loop-value%" contains "Price: ":
set {_price::*} to loop-value split at "Price: "
set {_price} to {_price::2} parsed as number
add {_price} to {sellprice.%player%.tprice}
on unstore:
set {_store::*} to lore of event-item split at "||"
loop {_store::*}:
if "%loop-value%" contains "Price: ":
set {_price::*} to loop-value split at "Price: "
set {_price} to {_price::2} parsed as number
set {_price} to "%0-{_price}%" parsed as number
add {_price} to {sellprice.%player%.tprice}
on inventory click:
if name of player's current inventory is "&aShop":
set slot 22 of player's current inventory to diamond named "&cSell" with lore "&bPrice: %{sellprice.%player%.tprice}% ||&bbalance: %player's balance%"
if clicked slot is 22:
add {sellprice.%player%.tprice} to player's balance
set {sellprice.%player%.tprice} to 0
close player's inventory
else if clicked item is glass named "&bShift Click the item":
cancel event
else if clicked item is black stained glass named "&7Empty Slot":
cancel event
it say that i can only have one at most value
code_language.skript:
"%size of event-item%"