I have a dupe server on 1.17.1 and i am trying to make it so players can buy items from a shop using coins earned by killing other players, everything works except the the script that gives you the bought item and subtracts the required coins.
How can i make this work?
Code:
on right click:
block is a sign
line 1 is "BUY"
set {Cost} to line 2
{Coins.%player%} is greater than {Cost} - 1
set {Item} to line 3
add {item} to player's inventory
subtract {Cost} from {Coins.%player%}
message "<green>bought %{item}%!"
How can i make this work?