Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Hydra Eco
- #Economy based skript, using functions
- #addBal(player, money), add money to a player
- #getBal(player), returns the ammount of money a player has
- #removeBal(player, money), removes the specified amount of money from a player (Can be a negative, change the option "negativebal" to true)
- #setBal(player, money), sets a players bal to the specified amount of money
- options:
- NP: &c&lHydra Eco &8» &cInvalid Permissions
- negativebal: false
- function addBal(p: player, m: number):
- add {_m} to {money::%{_p}%}
- function getBal(p: player) :: number:
- if {money::%{_p}%} is not set:
- set {money::%{_p}%} to 0
- return {money::%{_p}%}
- function removeBal(p: player, m: number):
- if {@negativebal} is false:
- if {_m} > {money::%{_p}%}:
- message "&cA player cant have a negative balance" to console
- stop
- remove {_m} from {money::%{_p}%}
- function setBal(p: player, m: number):
- set {money::%{_p}%} to {_m}
- command /money [<text>] [<number>] [<offline player>]:
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if arg 1 is "give", "g" or "add":
- if player has permission "HydraEco.addmoney":
- addBal(arg 3, arg 2)
- send "&cAdded %arg 2%&c to %arg 3%&c's balance"
- else:
- send "{@NP}"
- else if arg 1 is "remove", "r" or "take":
- if player has permission "HydraEco.removemoney":
- removeBal(arg 3, arg 2)
- send "&cRemoved %arg 2%&c from %arg 2%&c's bal. Check console for more information if it didnt work."
- else:
- send "{@NP}"
- else if arg 1 is "set" or "s":
- if player has permission "HydraEco.setmoney":
- setBal(arg 3, arg 2)
- send "&cSet %arg 3%&c's bal to %arg 2%"
- else:
- send "&c&lHydra Eco"
- send "&c/money <add/remove/set> <money> <player>"
- send "&c&lHydra Eco"
- else:
- send "&c&lHydra Eco"
- send "&c/money <add/remove/set> <money> <player>"
- send "&c&lHydra Eco"
- command /bal [<offline player>]:
- permission: HydraEco.bal
- permission message: {@NP}
- trigger:
- if arg 1 is set:
- send "&c%arg 1%&c's balance: %{money::%arg 1%}%"
- else:
- send "&cYour balance: %{money::%player%}%"
- command /pay [<offline player>] [<number>]:
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if player has permission "HydraEco.pay":
- if getBal(player) >= arg 2:
- removeBal(player, arg 2)
- addBal(arg 1, arg 2)
- send "&b$%arg 2%&7 has been sent to &b%arg 1%"
- send "&b%arg 2%&7 has been recieved from &b%player%" to arg 1
- else:
- send "&cYou do not have enough money to send to that player!"
- else:
- send "{@NP}"
- else:
- send "&c/pay <player> <amount>"
- else:
- send "&c/pay <player> <amount>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement