"if ({_money} parsed as num) > {_amount::%player%}:" does not work. which is very strange, because in "set result %{_amount::%player%}% and %{_money}%%" the numbers are displayed
I additionally use this https://github.com/APickledWalrus/skript-placeholders
code_language.skript:
variables:
{amount::%player%} = 10
on placeholderapi placeholder request for the prefix "cost":
loop all items in inventory of player:
if loop-item is player head:
add item amount of loop-item *15 to {_amount::%player%}
if loop-item is gold ingot:
add item amount of loop-item *25 to {_amount::%player%}
if loop-item is golden sword or golden helmet or golden chestplate or golden leggings or golden boots or golden pickaxe:
add 40 to {_amount::%player%}
if loop-item is slime ball:
if custom model data of loop-item is 10000:
add item amount of loop-item *15 to {_amount::%player%}
if loop-item is slime ball:
if custom model data of loop-item is 10001:
add item amount of loop-item *25 to {_amount::%player%}
set {_money} to placeholder "vault_eco_balance" from player
if ({_money} parsed as num) > {_amount::%player%}:
set the result to "%{_money}%"
else:
set the result to "%{_amount::%player%}% and %{_money}%"
on death of player:
execute console command "money give %attacker% %placeholder "cost" from victim%"
I additionally use this https://github.com/APickledWalrus/skript-placeholders