Code:
set {_stock} to line 2 of lore of clicked item
replace "- Stock : " with "" in {_stock}
set {_stock} to "%{_stock}%" parsed as integer
set {_sum} to {_stock} - item number of clicked item
broadcast "%{_stock}%, %{_sum}%"
{_sum} < 0:
set {_clicked} to clicked item
set clicked item to barrier named "&cNot Enough Stock!"
wait 2 second
set clicked item to {_clicked}
stop
Line 2 of lore of clicked item is
"- Stock : %integer%".
5th line of the code,
"broadcast "%{_stock}%, %{_sum}%"",
When broadcast outputs {_stock}, it is set correctly. But when I do
"{_stock} - item number of clicked item"
It keeps outputting negative numbers and {_stock} is considered as 0...
What is wrong with this arithmetic???
Skript ver : 2.2-dev34