Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /sell [<text>]:
- trigger:
- if arg 1 is not set:
- execute player command "/merchant"
- if arg 1 is "coal":
- if player has coal item:
- while amount of coal item in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 coal item from player's inventory
- add 0.10 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- if arg 1 is "iron":
- if {level.%uuid of player%} >= 10:
- if player has iron ingot:
- while amount of iron ingot in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 iron ingot from player's inventory
- add 0.15 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 10 &7to sell this."
- if arg 1 is "gold":
- if {level.%uuid of player%} >= 20:
- if player has gold ingot:
- while amount of gold ingot in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 gold ingot from player's inventory
- add 0.20 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 20 &7to sell this."
- if arg 1 is "redstone":
- if {level.%uuid of player%} >= 30:
- if player has redstone dust:
- while amount of redstone dust in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 redstone dust from player's inventory
- add 0.30 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 30 &7to sell this."
- if arg 1 is "diamond":
- if {level.%uuid of player%} >= 50:
- if player has diamond:
- while amount of diamond in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 diamond from player's inventory
- add 1 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 50 &7to sell this."
- if arg 1 is "emerald":
- if {level.%uuid of player%} >= 75:
- if player has emerald:
- while amount of emerald in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 emerald from player's inventory
- add 1.75 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 75 &7to sell this."
- if arg 1 is "quartz":
- if {level.%uuid of player%} >= 100:
- if player has quartz item:
- while amount of quartz item in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 quartz item from player's inventory
- add 2.50 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 100 &7to sell this."
- if arg 1 is "lapis":
- if {level.%uuid of player%} >= 40:
- if player has lapis:
- while amount of lapis in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 lapis from player's inventory
- add 0.50 to {_payout.%player%}
- message ""
- message " &aSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold &d%{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &b$%{_payout.%player%}% &7in total."
- message ""
- add {_payout.%player%} to player's balance
- stop
- else:
- message "&c&lHey! &7You don't have enough of this item to sell it."
- else:
- message "&c&lHey! &7You must be &bLevel 40 &7to sell this."
- command /merchant:
- trigger:
- message "&a[NPC] Merchant: &fHey %player%, come sell some items!"
- open chest with 5 rows named "The Merchant" to player
- wait 0.6 ticks
- format slot 4 of player with nether star named "&a&l%player%'s Balance" with lore "&fYou have &2%player's balance%" to be unstealable
- format slot 20 of player with coal item named "&eCoal" with lore "&cRequired Level: 0||||&fPrice: &a$0.10 each||||&fClick here to sell." to run [player command "/sell coal"]
- format slot 21 of player with iron ingot named "&eIron" with lore "&cRequired Level: 10||||&fPrice: &a$0.15 each||||&fClick here to sell." to run [player command "/sell iron"]
- format slot 22 of player with gold ingot named "&eGold" with lore "&cRequired Level: 20||||&fPrice: &a$0.20 each||||&fClick here to sell." to run [player command "/sell gold"]
- format slot 23 of player with redstone dust named "&eRedstone" with lore "&cRequired Level: 30||||&fPrice: &a$0.30 each||||&fClick here to sell." to run [player command "/sell redstone"]
- format slot 24 of player with lapis lazuli named "&eLapis Lazuli" with lore "&cRequired Level: 40||||&fPrice: &a$0.50 each||||&fClick here to sell." to run [player command "/sell lapis"]
- format slot 30 of player with diamond named "&eDiamond" with lore "&cRequired Level: 50||||&fPrice: &a$1 each||||&fClick here to sell." to run [player command "/sell diamond"]
- format slot 31 of player with emerald named "&eEmerald" with lore "&cRequired Level: 75||||&fPrice: &a$1.75 each||||&fClick here to sell." to run [player command "/sell emerald"]
- format slot 32 of player with quartz item named "&eQuartz" with lore "&cRequired Level: 100||||&fPrice: &a$2.50 each||||&fClick here to sell." to run [player command "/sell quartz"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement