Yeah, it's me again. So..
I want skript to ignore actually the total amount of the item in the player's inventory. They should just sell 1 if they have more than 1 in their inventory. But with this skript, when i have e.g 10 stacks of Iron ingots, it sells 10 iron ingots although it should just sell one.
code_language.skript:
on inventory click:
if event-inventory is not player's inventory:
if name of player's current inventory is "&cErze":
cancel event
if clicked slot is 9:
close inventory of player
make player execute command "/shop"
if player has enough space for 64 dirt:
clicked item is not air:
clicked slot is 0:
if clicked type is LEFT mouse:
if {coins::%player%} is more than {@ironpricebuyandsell}-1:
give player a iron ingot
remove {@ironpricebuyandsell} from {coins::%player%}
send "{@buyed1}"
else if clicked type is right mouse:
loop all items in the player's inventory:
if loop-item is iron ingot:
if amount of loop-item is more than 0:
remove 1 iron ingot from the player
play "NOTE_PLING" to player at volume 0.2
add {@ironpricebuyandsell} to {coins::%player%}
#send "{@selled1}"
else:
send "{@needone}"
else if clicked type is right mouse button with shift:
loop all items in the player's inventory:
if loop-item is iron ingot:
if amount of loop-item is more than 63:
set {_amountitem} to amount of loop-item
remove 64 iron ingot from the player
play "NOTE_PLING" to player at volume 0.2
add {@ironpricebuyandsell}*64 to {coins::%player%}
#send "{@selledstack}"
else:
send "{@needstack}"
else if clicked type is left mouse button with shift:
if {coins::%player%} is more than {@ironpricebuyandsell}*64-1:
remove {@ironpricebuyandsell}*64 from {coins::%player%}
send "{@buyedstack}"
loop 64 times:
wait 1 tick
give player a iron ingot
I want skript to ignore actually the total amount of the item in the player's inventory. They should just sell 1 if they have more than 1 in their inventory. But with this skript, when i have e.g 10 stacks of Iron ingots, it sells 10 iron ingots although it should just sell one.