Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Slave Market
- #thewormy / jordanleevan
- options:
- P: &8[&6Slave Market&8]&7
- C: &7
- H: &e
- command /slave [<text>] [<text>] [<text>]:
- permission: skript.op
- aliases: /sm
- trigger:
- if arg-1 is set:
- if arg-1 is "owner":
- if arg-2 is set:
- if arg-2 is "add":
- if arg-3 is set:
- if {sm::slaveOwner::%arg-3%} is set:
- send "{@P} %arg-3% is already a slave owner"
- else if {sm::sOwnerCount} is greater than 7:
- send "{@P} There are already 8 slave owners"
- else:
- if {sm::diamonds} is not set:
- set {sm::diamonds} to 30
- send "{@P} Diamonds set to 30!"
- increase {sm::sOwnerCount} by 1
- set {sm::slaveOwner::%arg-3%} to true
- console command "give %arg-3% diamond %{sm::diamonds}%"
- if {sm::teamNumber} is not set:
- set {sm::teamNumber} to 1
- player command "/team reset"
- else:
- increase {sm::teamNumber} by 1
- player command "/team create"
- player command "/team set %arg-3% %{sm::teamNumber}%"
- broadcast "{@P} {@H}%arg-3% {@C}is now a slave master!"
- else:
- send "{@P} /slave owner <add> <player>"
- else if arg-2 is "list":
- send "{@P} Slave Owners: "
- loop all players:
- if {sm::slaveOwner::%loop-player%} is true:
- send "- %loop-player%"
- else if arg-1 is "start":
- if {sm::Running} is set:
- send "{@P} Slave market already running!"
- send "{@P} {@H}/sm end {@C}to end current slave market"
- else:
- set {sm::Running} to true
- if {sm::diamonds} is not set:
- set {sm::diamonds} to 30
- send "{@P} Diamonds set to 30!"
- loop all players:
- if {sm::slaveOwner::%loop-player%} is not set:
- if {sm::ignore::%loop-player%} is not set:
- add loop-player to {sm::slaves::*}
- player command "/chat mute"
- set {sm::currentSlave} to (random element of {sm::slaves::*})
- while {sm::currentSlave} is offline:
- delete {sm::currentSlave}
- set {sm::currentSlave} to (random element of {sm::slaves::*})
- set {sm::currentBid} to -1
- set {sm::bidTimer} to 15
- broadcast "{@P} {@H}%{sm::currentSlave}% {@C}is now up for auction!"
- loop all players:
- if {sm::slaveOwner::%loop-player%} is set:
- send "{@P} Use {@H}/bid {@C}to bid!"
- else if arg-1 is "ignore":
- if arg-2 is set:
- if arg-2 is "add" or "remove":
- arg-3 is set
- if {sm::ignore::%arg-3%} is set:
- delete {sm::ignore::%arg-3%}
- send "{@P} %arg-3% removed from ignore list"
- else:
- set {sm::ignore::%arg-3%} to true
- send "{@P} %arg-3% added to ignore list"
- else:
- if {sm::ignore::%arg-2%} is set:
- delete {sm::ignore::%arg-2%}
- send "{@P} %arg-2% removed from ignore list"
- else:
- set {sm::ignore::%arg-2%} to true
- send "{@P} %arg-2% added to ignore list"
- else:
- send "{@P} /slave ignore <add:remove:player*> <player*>"
- else if arg-1 is "diamonds":
- if arg-2 is set:
- if arg-2 is "set":
- arg-3 is set
- set {_diamonds} to arg-3 parsed as number
- if {_diamonds} is not less than 1:
- set {sm::diamonds} to {_diamonds}
- send "{@P} Diamonds set to %arg-3%"
- else if arg-2 is "save":
- loop all players:
- if loop-player's inventory contains diamonds:
- set {sm::sDiamonds::%loop-player%} to amount of diamonds in loop-player's inventory
- send "{@P} %{sm::sDiamonds::%loop-player%}% diamonds have been saved in your inventory"
- send "{@P} Removing them from your inventory now"
- remove all diamonds from loop-player's inventory
- else if arg-2 is "give":
- loop all players:
- if {sm::slaveOwner::%loop-player%} is set:
- if {sm::sDiamonds::%loop-player%} is set:
- console command "give %loop-player% diamond %{sm::sDiamonds::%loop-player%}%"
- send "{@P} You have been given {@H}%{sm::sDiamonds::%loop-player%}% {@C}diamonds!"
- else:
- send "{@P} /slave diamonds <number of diamonds>"
- else if arg-1 is "reset":
- if arg-2 is not set:
- send "{@P} Are you sure you want to reset?"
- send "{@P} {@H}/slave reset confirm {@C}to confirm"
- else if arg-2 is "confirm":
- send "{@P} Slave Market reset"
- delete {sm::*}
- else if arg-1 is "help":
- send "{@P} insert commands here"
- else:
- player command "/slave help"
- command /bid [<int>]:
- trigger:
- if command sender's inventory contains arg-1 diamonds:
- if {sm::Running} is set:
- if {sm::bidTimer} is set:
- if {sm::slaveOwner::%command sender%} is set:
- if arg-1 is greater than 0:
- if arg-1 is greater than {sm::currentBid}:
- set {sm::currentBid} to arg-1
- set {sm::highBidder} to command sender
- broadcast "{@P} {@H}%command sender% {@C}bid {@H}%arg-1% {@C}diamonds"
- if {sm::bidTimer} is less than 5:
- add 5 to {sm::bidTimer}
- else:
- send "{@P} Current bid is higher! {@H}%{sm::currentBid}%"
- else:
- send "{@P} You need to bid a positive number"
- else:
- send "{@P} You aren't a slave owner"
- else:
- send "{@P} No timer running!"
- else:
- send "{@P} No game in progress!"
- every 1 real second:
- if {sm::Running} is set:
- if {sm::bidTimer} is set:
- remove 1 from {sm::bidTimer}
- if {sm::bidTimer} is less than 5:
- broadcast "{@P} {@H}%{sm::bidTimer}% {@C}seconds remaining!"
- else if {sm::bidTimer} is 0:
- broadcast "{@P} {@H}%{sm::highBidder}% {@C}won the bid for {@H}%{sm::currentSlave}%"
- broadcast "{@P} {@H}%{sm::currentBid}% {@C}diamonds"
- console command "team set %{sm::currentSlave}% %{TeamNumber::%{sm::highBidder}%}%"
- remove {sm::currentSlave} from {sm::slaves::*}
- remove {sm::currentBid} of diamonds from {sm::highBidder}
- #reset
- delete {slave::bidTimer}
- delete {sm::highBidder}
- set {sm::currentBid} to -1
- set {sm::currentSlave} to (random element of {sm::slaves::*})
- while {sm::currentSlave} is offline:
- delete {sm::currentSlave}
- set {sm::currentSlave} to (random element of {sm::slaves::*})
- broadcast "{@P} {@H}%{sm::currentSlave}% {@C}is now up for auction!"
- set {sm::bidTimer} to 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement