Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /sell [<text>]:
- trigger:
- if arg 1 is not set:
- open chest with 5 rows named "Sell your items..." to player
- wait 0.6 ticks
- format slot 0 of player with book named "&e&l%player%'s balance" with lore "&fMoney &a%player's balance%" to be unstealable
- format slot 10 of player with coal ore named "&e&lCoal" with lore "&r ||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your coal." to run [player command "/sell coalore"]
- format slot 11 of player with iron ore named "&e&lIron" with lore "&r ||&fPrice &a$0.45 each||&r ||&6&lClick &fto sell all your iron." to run [player command "/sell ironore"]
- format slot 12 of player with gold ore named "&e&lGold" with lore "&r ||&fPrice &a$0.75 each||&r ||&6&lClick &fto sell all your gold." to run [player command "/sell goldore"]
- format slot 13 of player with diamond ore named "&e&lDiamond" with lore "&r ||&fPrice &a$1.35 each||&r ||&6&lClick &fto sell all your diamonds." to run [player command "/sell diamondore"]
- format slot 14 of player with emerald ore named "&e&lEmerald" with lore "&r ||&fPrice &a$2 each||&r ||&6&lClick &fto sell all your emeralds." to run [player command "/sell emeraldore"]
- if arg 1 is "coalore":
- if player has coal:
- while amount of coal in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 coal from player's inventory
- add 0.15 to {_payout.%player%}
- message ""
- message " &e&lSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &a$%{_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 "ironore":
- 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.45 to {_payout.%player%}
- message ""
- message " &e&lSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &a$%{_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 "goldore":
- if player has gold:
- 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.75 to {_payout.%player%}
- message ""
- message " &e&lSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &a$%{_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 "diamondore":
- 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.35 to {_payout.%player%}
- message ""
- message " &e&lSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &a$%{_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 "emeraldore":
- 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 2 to {_payout.%player%}
- message ""
- message " &e&lSold %{_amount.%player%}% Items:"
- message ""
- message "&7 You sold %{_amount.%player%}% &7items for $%{_payout.%player%} / {_amount.%player%}% &7each"
- message "&7 and received &a$%{_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."
Advertisement
Add Comment
Please, Sign In to add comment