Advertisement
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 Ore" with lore "&r ||&fPrice &a$0.15 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell coalore"]
- format slot 11 of player with iron ore named "&e&lIron Ore" with lore "&r ||&fPrice &a$0.45 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell ironore"]
- format slot 12 of player with gold ore named "&e&lGold Ore" with lore "&r ||&fPrice &a$0.75 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell goldore"]
- format slot 13 of player with diamond ore named "&e&lDiamond Ore" with lore "&r ||&fPrice &a$1.35 each||&r ||&6&lClick &fto sell all your coal ore." to run [player command "/sell diamondore"]
- if arg 1 is "coalore":
- if player has coal ore:
- while amount of coal ore in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 coal ore 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 ore:
- while amount of iron ore in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 iron ore 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 ore:
- while amount of gold ore in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 gold ore 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 ore:
- while amount of diamond ore in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 diamond ore 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."
- command /purchase [<text>]:
- trigger:
- if arg 1 is "woodpick":
- if player's balance >= 15:
- remove 15 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eWooden Pickaxe &ffor &2$15&f, &e%player%&f!"
- give wood pick to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- if arg 1 is "stonepick":
- if {level::%uuid of player%} >= 5:
- if player's balance >= 30:
- remove 30 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eStone Pickaxe &ffor &2$30&f, &e%player%&f!"
- give stone pick to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- else:
- message "&c&lHey! &7You must be Level 5 or higher to purchase this."
- if arg 1 is "ironpick":
- if {level::%uuid of player%} >= 10:
- if player's balance >= 45:
- remove 45 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eIron Pickaxe &ffor &2$45&f, &e%player%&f!"
- give iron pick to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- else:
- message "&c&lHey! &7You must be Level 10 or higher to purchase this."
- if arg 1 is "diamondpick":
- if {level::%uuid of player%} >= 20:
- if player's balance >= 75:
- remove 75 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eDiamond Pickaxe &ffor &2$45&f, &e%player%&f!"
- give diamond pick to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- else:
- message "&c&lHey! &7You must be Level 20 or higher to purchase this."
- if arg 1 is "goldpick":
- if {level::%uuid of player%} >= 30:
- if player's balance >= 150:
- remove 150 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eGold Pickaxe &ffor &2$45&f, &e%player%&f!"
- give gold pick to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- else:
- message "&c&lHey! &7You must be Level 30 or higher to purchase this."
- if arg 1 is "woodpick2":
- if player's balance >= 30:
- remove 30 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eWooden Pickaxe Tier 2 &ffor &2$30&f, &e%player%&f!"
- give wood pick of efficiency 1 to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- if arg 1 is "woodpick3":
- if player's balance >= 60:
- remove 60 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eWooden Pickaxe Tier 3 &ffor &2$60&f, &e%player%&f!"
- give wood pick of efficiency 2 to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- if arg 1 is "stonepick2":
- if player's balance >= 60:
- remove 60 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eStone Pickaxe Tier 2 &ffor &2$60&f, &e%player%&f!"
- give wood pick of efficiency 1 to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
- if arg 1 is "stonepick3":
- if player's balance >= 120:
- remove 120 from player's balance
- message "&a[NPC] Miner: &fThanks for buying a &eStone Pickaxe Tier 3 &ffor &2$120&f, &e%player%&f!"
- give wood pick of efficiency 2 to player
- else:
- message "&c&lHey! &7You don't have enough money to buy this!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement