Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # Jobs
- # Author: BreakfastDeliqht
- # Created On: 09/21/2019
- # Version: 0.0.1
- #
- function jobs(p: player):
- set {_u} to uuid of {_p}
- open virtual chest inventory with size 3 named "&8Available Jobs" to {_p}
- format gui slot 26 of {_p} with red stained glass pane named "&cResign" with lore " ", "&cResign from your current job.", and " " to run:
- make {_p} execute command "resign"
- format gui slot 0 of {_p} with golden apple named "&9Doctor" with lore " ", "&bHeal players for a small fee!", "&bPaycheck: $10 per heal." and " " to run:
- doctor(player)
- format gui slot 1 of {_p} with iron ingot named "&9Miner" with lore " ", "&bMine for money!", "&bPaycheck: VARIES", and " " to run:
- miner(player)
- format gui slot 2 of {_p} with oak log named "&9Lumberjack" with lore " ", "&bCut down trees for money!", "&bPaycheck: VARIES", and " " to run:
- lumberJack(player)
- function doctor(p: player):
- set {_u} to uuid of {_p}
- if {employed::%{_u}%} is true:
- send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
- else if {employed::%{_u}%} is not set:
- send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &cDoctor!" to {_p}
- set {job::%{_u}%} to "Doctor"
- set {employed::%{_u}%} to true
- function miner(p: player):
- set {_u} to uuid of {_p}
- if {employed::%{_u}%} is true:
- send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
- else if {employed::%{_u}%} is not set:
- send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &6Miner!" to {_p}
- set {job::%{_u}%} to "Miner"
- set {employed::%{_u}%} to true
- function lumberJack(p: player):
- set {_u} to uuid of {_p}
- if {employed::%{_u}%} is true:
- send "&9&l• &9Employed &8&l» &7You are already &9employed!" to {_p}
- else if {employed::%{_u}%} is not set:
- send "&9&l• &9Employed &8&l» &7You are now &9employed &7as a &5Lumberjack!" to {_p}
- set {job::%{_u}%} to "Lumberjack"
- set {employed::%{_u}%} to true
- command /jobs:
- trigger:
- jobs(player)
- on right click on a player:
- if {job::%player's uuid%} is "Doctor":
- if clicked player's name is "&7Miner":
- cancel event
- else:
- set {request.%clicked player%} to true
- set {request.%player%} to true
- send "&9&l• &9Employed &8&l» &7You sent a heal request to &b%clicked player% &7for $10." to player
- send "&9&l• &9Employed &8&l» &7%player% &7is trying to &cheal you! &7Do &c/heal accept &7to be healed for $10." to clicked player
- wait 30 seconds
- if {request.%clicked player%} is not set:
- add 10 to player's balance
- send "&9&l• &9Employed &8&l» &7%clicked player% &7accepted your request. They were healed." to player
- else if {request.%clicked player%} is true:
- delete {request.%clicked player%}
- delete {request.%player%}
- send "&9&l• &9Employed &8&l» &7%clicked player% &7failed to accept." to player
- send "&9&l• &9Employed &8&l» &7You failed to accept." to clicked player
- command /heal [<text>]:
- trigger:
- if arg-1 is not set:
- send "&9&l• &9Employed &8&l» &7/heal accept."
- else if arg-1 is "accept":
- if {request.%player%} is true:
- if player's balance >= 10:
- delete {request.%player%}
- remove 10 from player's balance
- heal player
- send "&9&l• &9Employed &8&l» &7You were healed for $10."
- else:
- send "&9&l• &9Employed &8&l» &7Insufficient Balance."
- else:
- send "&9&l• &9Employed &8&l» &7You don't have a pending request."
- else:
- send "&9&l• &9Employed &8&l» &7/heal accept."
- function minerShop(p: player):
- set {_u} to uuid of {_p}
- open virtual chest inventory with size 1 named "&8Miner Shop" to {_p}
- format gui slot 0 of {_p} with cobblestone named "&9Cobblestone" with lore " ", "&9Worth: &b$0.05", "&bClick to sell all cobblestone.", and " " to run:
- set {_amt} to amount of cobblestone in {_p}'s inventory
- set {_ttl} to {_amt} * 0.05
- add {_ttl} to {_p}'s balance
- remove all cobblestone from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 1 of {_p} with coal named "&9Coal" with lore " ", "&9Worth: &b$0.10", "&bClick to sell all coal.", and " " to run:
- set {_amt} to amount of coal in {_p}'s inventory
- set {_ttl} to {_amt} * 0.10
- add {_ttl} to {_p}'s balance
- remove all coal from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 2 of {_p} with iron ore named "&9Iron Ore" with lore " ", "&9Worth: &b$0.25", "&bClick to sell all iron ore.", and " " to run:
- set {_amt} to amount of iron ore in {_p}'s inventory
- set {_ttl} to {_amt} * 0.25
- add {_ttl} to {_p}'s balance
- remove all iron ore from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 3 of {_p} with iron ingot named "&9Iron Ingot" with lore " ", "&9Worth: &b$0.50", "&bClick to sell all iron ingots.", and " " to run:
- set {_amt} to amount of iron ingot in {_p}'s inventory
- set {_ttl} to {_amt} * 0.50
- add {_ttl} to {_p}'s balance
- remove all iron ingot from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 4 of {_p} with gold ore named "&9Gold Ore" with lore " ", "&9Worth: &b$0.75", "&bClick to sell all gold ore." and " " to run:
- set {_amt} to amount of gold ore in {_p}'s inventory
- set {_ttl} to {_amt} * 0.75
- add {_ttl} to {_p}'s balance
- remove all gold ore from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 5 of {_p} with gold ingot named "&9Gold Ingot" with lore " ", "&9Worth: &b$1.00", "&bClick to sell all gold ingots." and " " to run:
- set {_amt} to amount of gold ingot in {_p}'s inventory
- set {_ttl} to {_amt} * 1.00
- add {_ttl} to {_p}'s balance
- remove all gold ingot from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 6 of {_p} with diamond named "&9Diamond" with lore " ", "&9Worth: &b$2.00", "&bClick to sell all diamonds." and " " to run:
- set {_amt} to amount of diamond in {_p}'s inventory
- set {_ttl} to {_amt} * 2.00
- add {_ttl} to {_p}'s balance
- remove all diamond from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 7 of {_p} with emerald named "&9Emerald" with lore " ", "&9Worth: &b$2.50", "&bClick here to sell all emeralds." and " " to run:
- set {_amt} to amount of emerald in {_p}'s inventory
- set {_ttl} to {_amt} * 2.50
- add {_ttl} to {_p}'s balance
- remove all emerald from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- format gui slot 8 of {_p} with obsidian named "&9Obsidian" with lore " ", "&9Worth: &b$2.75", "&bClick here to sell all obsidian." and " " to run:
- set {_amt} to amount of obsidian in {_p}'s inventory
- set {_ttl} to {_amt} * 2.75
- add {_ttl} to {_p}'s balance
- remove all obsidian from {_p}'s inventory
- set action bar of {_p} to "&9+$%{_ttl}%"
- command /resign:
- trigger:
- set {_u} to uuid of player
- if {employed::%{_u}%} is set:
- if {job::%{_u}%} is set:
- delete {employed::%{_u}%}
- delete {job::%{_u}%}
- send "&9&l• &9Employed &8&l» &7You resigned from your job!"
- else:
- send "&9&l• &9Employed &8&l» &7You are not employed!"
- else:
- send "&9&l• &9Employed &8&l» &7You are not employed!"
- on right click on player:
- if name of clicked player is "&7Miner":
- if {job::%player's uuid%} is "Miner":
- minerShop(player)
- else if {job::%player's uuid%} is not "Miner":
- send "&9&l• &9Employed &8&l» &7You are not a Miner!" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement