Hello, I'm trying to make a GUI when /sell is done. You are supposed to drag and drop the listed items then they will be sold and give the player the set money. Here's what I got so far, I get no errors, the GUI opens correctly but when I drop the items and close the GUI, nothing happens.
Note: Im using TUSKE as GUI.
[doublepost=1588529020,1588487363][/doublepost]bump
Note: Im using TUSKE as GUI.
Code:
options:
p: &8&8SELL » #Prefix
iron: 30 #1 iron ingot sell price
gold: 40 #1 gold ingot sell price
command /sell:
trigger:
open virtual chest with 1 row named "&8Drag and drop to sell" to player
#here player's will drag and drop their items
on inventory click:
if inventory name of current inventory of player contains "&8Drag and drop to sell":
if slot 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 of current inventory of player is iron ingot:
set {_itemcounti} to number of all iron ingots in event-inventory
remove {_itemcounti} of iron ingots from event-inventory
add {@iron} * {_itemcounti} to the player's money
send "{@p} &8You sold %{_itemcounti}% iron ingot. &a%{@iron} * {_itemcounti}% was added to your wallet"
else if slot 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 of current inventory of player is gold ingot:
set {_itemcountg} to number of all iron ingots in event-inventory
remove {_itemcountg} of iron ingots from event-inventory
add {@gold} * {_itemcountg} to the player's money
send "{@p} &8You sold %{_itemcountg}% gold ingot. &a%{@gold} * {_itemcountg}% was added to your wallet"
else:
send "{@p} &cYou are not allowed to sell that item!"