How can i add the {_value} to the {selled} variable?
Code:
variables:
{selled} = 0
on inventory click:
if event-inventory = (metadata tag "SellerGui" of player):
cancel event
if index of event-slot is 20:
if player has carrot:
set {_value} to the value of the placeholder "math_0:1_{checkitem_amount_mat:carrot}" for the player
add {_value} to {selled}
execute console command "/clear %player% carrot %{_value}%"
message "Total carrot selled is %{selled}%"
send "%{_value}%" to the player
command /gui:
permission: op
permission message: "&4You can't do it!"
trigger:
set metadata tag "SellerGui" of player to chest inventory with 5 rows named "test"
set slot 20 of metadata tag "SellerGui" of player to a carrot named "Example"
open (metadata tag "SellerGui" of player) to player