I have a function like this:
But when I click a inventory like chest inventory, the output is always 0
Then I change the Skript to this:
And find that all things work well.
So how can I make a function to check the amount?
Code:
function invAmountMI(type: string,inv: inventory) :: number:
set {_amount} to 0
loop all items in {_inv}:
if name of loop-item contains "{_type}":
add 1 to {_amount}
return {_amount}
on inventory click:
set {_Aamount} to invAmountMI("Wood",event-inventory)
send "%{_Aamount}%"
Then I change the Skript to this:
Code:
on inventory click:
set {_amount} to 0
loop all items in event-inventory:
if name of loop-item contains "Wood":
add 1 to {_amount}
send "%{_amount}%"
So how can I make a function to check the amount?