Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &2[&aEconomy Plus&2] &a
- startingbal: 100 # starting bal
- sign: $ # The eco sign for stuff
- aminecost: 110
- # prices
- cobblestoneprice: 1
- coalprice: 2
- ironprice: 5
- on load:
- clear {economy::blocks::*}
- add cobblestone to {economy::blocks::*}
- add coal to {economy::blocks::*}
- add iron ore to {economy::blocks::*}
- set {_i} to 1
- on connect:
- if {economy::bal::%player%} is not set:
- set {economy::bal::%player%} to 100
- command /shop [<text>] [<text>]:
- trigger:
- if arg 1 is not set:
- wait 2 ticks
- open chest with 6 rows named "&cShop" to player
- wait 2 ticks
- loop integers between 0 and 54 - 1:
- format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
- format slot 20 of player with red wool named "&cSell Items" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop sell"]
- format slot 24 of player with green wool named "&aBuy Items" with lore "&7Buy tools, armor, and wepons here" to close then run [make player execute command "/shop buy"]
- format slot 31 of player with magenta glazed terracotta named "&dRank &5Upgrade" with lore "&7Rankup and get acess to higher level mines" to close then run [make player execute command "/shop rankup"]
- else:
- if arg 1 is "sell" or "buy" or "rankup":
- #sell
- if arg 1 is "sell":
- if arg 2 is not set:
- wait 2 ticks
- open chest with 6 rows named "&cShop" to player
- wait 2 ticks
- loop integers between 0 and 54 - 1:
- format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
- format slot 10 of player with cobblestone named "&fcobblestone" with lore "" to close then run [make player execute command "/shop sell cobblestone"]
- format slot 11 of player with coal named "&fCoal" to close then run [make player execute command "/shop sell coal"]
- format slot 12 of player with iron ore named "&fIron ore" to close then run [make player execute command "/shop sell iron ore"]
- else:
- if {economy::blocks::*} contains arg 2:
- message "{@prefix}Executing sell"
- set {_i} to arg 2
- set {_p} to player
- if {_i} is cobblestone:
- set {_price} to {@cobblestoneprice}
- if {_i} is coal:
- set {_price} to {@coalprice}
- if {_i} is iron ore:
- set {_price} to {@ironprice}
- set {_itemstheyhave} to number of {_i} in {_p}'s inventory
- if {_itemstheyhave} > 0:
- set {_amnttoadd} to {_price}*{_itemstheyhave}
- add {_amnttoadd} to {economy::bal::%player%}
- remove all {_i} from {_p}
- send "{@prefix}Sold %{_itemstheyhave}% item(s) totaling {@sign}%{_amnttoadd}%" to {_p}
- else:
- message "{@prefix}You need to have at least 1 of that item!"
- else:
- message "{@prefix}Unknown item!"
- #buy
- if arg 1 is "buy":
- if arg 2 is not set:
- wait 2 ticks
- open chest with 6 rows named "&aBuy Items" to player
- wait 2 ticks
- loop integers between 0 and 54 - 1:
- format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
- format slot 20 of player with diamond pickaxe named "&bPickaxes" with lore "&7Upgrade and enchant your pickaxe here" to close then run [make player execute command "/shop buy pickaxe"]
- format slot 22 of player with iron horse armor named "&cWepons" with lore "&7Buy tools, armor, and wepons here" to close then run [make player execute command "/shop buy wepons"]
- format slot 24 of player with chainmail chestplate named "&aArmor" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop buy armor"]
- format slot 40 of player with barrier named "&cBack" with lore "&7Sell your mined items here" to close then run [make player execute command "/shop"]
- else if arg 2 is "pickaxe" or "wepons" or "armor":
- if arg 2 is "pickaxe":
- wait 2 ticks
- open chest with 3 rows named "&3Pickaxe" to player
- wait 2 ticks
- loop integers between 0 and 27 - 1:
- format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
- format slot 0 of player with paper named "&fInfo" with lore "&fHere you can upgrade your pickaxe with just one click, assuming you have the right amount of experiance and money." to be unstealable
- format slot 18 of player with Sunflower named "&a%{economy::bal::%player%}% &2Credits" to be unstealable
- #rankup
- if arg 1 is "rankup":
- rankupgrade(player)
- if {economy::rankup::%player%} is true:
- wait 2 ticks
- open chest with 3 rows named "&dRank &5Upgrade" to player
- wait 2 ticks
- loop integers between 0 and 27 - 1:
- format slot loop-number of player with gray stained glass pane named "&r" to be unstealable
- format slot 0 of player with paper named "&fInfo" with lore "&fHere you can upgrade your rank with just one click, assuming you have a high enough balance." to be unstealable
- format slot 18 of player with Sunflower named "&a%{economy::bal::%player%}% &2Credits" to be unstealable
- format slot 13 of player with diamond pickaxe named "%{price::%player%}%" to be unstealable
- else:
- else:
- message "{@prefix}Unknown category!"
- command /bal [<offline player>]:
- aliases: /balance, /money, /coins
- trigger:
- if arg 1 is not set:
- message "{@prefix}Your current balance is {@sign}%{economy::bal::%player%}%"
- else:
- if {economy::bal::%arg 1%} is not set:
- message "{@prefix}%arg 1% has not logged on to the server before!"
- else:
- message "{@prefix}%arg 1% current bal is {@sign}%{economy::bal::%arg 1%}%"
- function sellitm(p: player, i: item):
- set {_price} to {economy::shop::price::%{_i}%}
- set {_itemstheyhave} to number of {_i} in {_p}'s inventory
- if {_itemstheyhave} > 1:
- set {_amnttoadd} to {_price} * {_itemstheyhave}
- add {_amnttoadd} to {economy::bal::%{_p}%}
- loop integers between 1 and {_itemstheyhave}:
- remove all {_i} from {_p}
- send "{@prefix}Sold %{_itemstheyhave}% items totaling {@sign}%{_amnttoadd}%" to {_p}
- function rankupgrade(p: player):
- set {_prices} to {aminecost}*{rankup::teir::%{_p}%}
- set {price::%{_p}%} to {_prices}
- if {economy::bal::%{_p}%} > {_prices}:
- set {economy::rankup::%{_p}%} to true
- else:
- set {economy::rankup::%{_p}%} to false
- command /setbal [<integer>] [<player>]:
- aliases: /setbalance, /balset, /balanceset
- permission: economy.admin.resetbal
- permission message: "&4You do not have the permission required to preform this command."
- trigger:
- if arg 1 is not set:
- message "{@prefix}&cPlease specify a number"
- else if arg 1 is set:
- if arg 2 is not set:
- set {economy::bal::%player%} to arg 1
- message "{@prefix}%player%&a's bal was set to &2{@sign}%arg 1%"
- else:
- set {economy::bal::%arg 2%} to arg 1
- message "{@prefix}%arg 2%'s bal was set to %arg 1%"
- command /balreset [<offlineplayer>]:
- aliases: /balancereset
- permission: economy.admin.resetbal
- permission message: "&4You do not have the permission required to preform this command."
- trigger:
- set {economy::bal::%arg 1%} to {@startingbal}
- message "{@prefix}%arg 1%&a's bal was reset"
- command /ecohelp [<integer>]:
- aliases: /helpeco, /economyhelp, /helpeconomy
- trigger:
- message "{@prefix} Help &7---[Page 1 of 1]---"
- message "&c/bal &fView the amount of money you have"
- message "&c/shop &fAllows you to sell and buy items"
- message "&c/ecohelp &fThis page your looking at right now"
- message "&c/rankup &fOpens up the rankup menu"
- message "&c/setbal <number> <player> &fChange someones balance &7(admin only)"
- message "&c/resetbal &fResets a players balance &7(admin only)"
- command /rankup:
- trigger:
- make player execute command "/shop rankup"
- #----G-U-N-S-----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement