Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /sell [<text>]:
- trigger:
- if arg 1 is "cobblestone":
- if player has cobblestone:
- while amount of cobblestone in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 cobble from player's inventory
- add 0.10 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 "stone":
- if player has stone:
- while amount of stone in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 stone 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."
- if arg 1 is "charcoal":
- if player has charcoal:
- while amount of charcoal in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 charcoal from player's inventory
- add 0.20 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 "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 3 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 "ironnugget":
- if player has iron nugget:
- while amount of iron nugget in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 iron nugget from player's inventory
- add 0.30 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 "ironingot":
- 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 4 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 "goldnugget":
- if player has gold nugget:
- while amount of gold nugget in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 gold nugget from player's inventory
- add 0.40 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 "goldingot":
- 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 5 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 not set:
- execute player command "/sellall"
- if arg 1 is "log":
- if player has 17:0:
- while amount of 17:0 in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 17:0 from player's inventory
- add 0.50 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 "fish":
- if player has raw fish:
- while amount of raw fish in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 raw fish 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 "salmon":
- if player has raw salmon:
- while amount of raw salmon in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 salmon 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."
- if arg 1 is "pufferfish":
- if player has pufferfish:
- while amount of pufferfish in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 pufferfish from player's inventory
- add 50 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 "porkchop":
- if player has porkchop:
- while amount of porkchop in player's inventory is bigger than 0:
- add 1 to {_amount.%player%}
- remove 1 porkchop from player's inventory
- add 6.25 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 not set:
- execute player command "/sellall"
- command /sellall:
- trigger:
- open chest with 4 rows named "Sell your items" to player
- wait 0.6 ticks
- format slot 0 of player with paper named "&a&lYour Balance" with lore "&fMoney &a%player's balance%" to be unstealable
- format slot 10 of player with cobblestone named "&e&lLow Quality Stone" with lore "&7&oTier 1 Item||||&fPrice &a$0.10 each||&r ||&6&lClick &fto sell all your low quality stone." to run [player command "/sell cobblestone"]
- format slot 19 of player with stone named "&e&lHigh Quality Stone" with lore "&7&oTier 2 Item||||&fPrice &a$2 each||&r ||&6&lClick &fto sell all your high quality stone." to run [player command "/sell stone"]
- format slot 11 of player with charcoal named "&e&lLow Quality Coal" with lore "&7&oTier 1 Item||||&fPrice &a$0.20 each||&r ||&6&lClick &fto sell all your low quality coal." to run [player command "/sell charcoal"]
- format slot 20 of player with coal item named "&e&lHigh Quality Coal" with lore "&7&oTier 2 Item||||&fPrice &a$3 each||&r ||&6&lClick &fto sell all your high quality coal." to run [player command "/sell coal"]
- format slot 12 of player with iron nugget named "&e&lLow Quality Iron" with lore "&7&oTier 1 Item||||&fPrice &a$0.30 each||&r ||&6&lClick &fto sell all your low quality iron." to run [player command "/sell ironnugget"]
- format slot 21 of player with iron ingot named "&e&lHigh Quality Iron" with lore "&7&oTier 2 Item||||&fPrice &a$4 each||&r ||&6&lClick &fto sell all your high quality iron" to run [player command "/sell ironingot"]
- format slot 13 of player with gold nugget named "&e&lLow Quality Gold" with lore "&7&oTier 1 Item||||&fPrice &a$0.40 each||&r ||&6&lClick &fto sell all your low quality gold." to run [player command "/sell goldnugget"]
- format slot 22 of player with gold ingot named "&e&lHigh Quality Gold" with lore "&7&oTier 2 Item||||&fPrice &a$5 each||&r ||&6&lClick &fto sell all your high quality gold" to run [player command "/sell goldingot"]
- format slot 14 of player with 17:0 named "&e&lLog" with lore "&7&oTier 1 Item||||&fPrice &a$0.50 each||&r ||&6&lClick &fto sell all your log" to run [player command "/sell log"]
- format slot 23 of player with raw fish named "&e&lRaw Fish" with lore "&7&oTier 2 Item||||&fPrice &a$0.75 each||&r ||&6&lClick &fto sell all your fish" to run [player command "/sell fish"]
- format slot 15 of player with raw salmon named "&e&lRaw Salmon" with lore "&7&oTier 3 Item||||&fPrice &a$2 each||&r ||&6&lClick &fto sell all your salmon" to run [player command "/sell salmon"]
- format slot 24 of player with pufferfish named "&e&lPufferfish" with lore "&7&oTier 4 Item||||&fPrice &a$50 each||&r ||&6&lClick &fto sell all your pufferfish" to run [player command "/sell pufferfish"]
- format slot 16 of player with raw porkchop named "&e&lPorkchop" with lore "&7&oTier 2 Item||||&fPrice &a$6.25 each||&r ||&6&lClick &fto sell all your porkchop" to run [player command "/sell porkchop"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement