Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P: &e[&bSlaveMarket&e]&f
- command /slave [<text>] [<text>] [<text>]:
- permission: skript.op
- trigger:
- arg-1 is set
- if arg-1 is "owner":
- arg-2 is set
- if arg-2 is "add":
- arg-3 is set
- if {slave.diamonds} is not set:
- set {slave.diamonds} to 30
- if {slave.owners} is more than 7:
- message "{@P} &cError, there is already 8 slave owners."
- stop
- else:
- if {slave.owner::%arg-3%} is set:
- message "{@P} &cError, &6%arg-3% &cis already a slave owner."
- stop
- else:
- set {slave.owners} to ({slave.owners}+1)
- wait 2 ticks
- set {slave.owner::%arg-3%} to {slave.owners}
- console command "warp SlaveTeam%{slave.owners}% %arg-3%"
- console command "team join %{slave.owners}% %arg-3%"
- console command "give %arg-3% diamond %{slave.diamonds}%"
- broadcast "{@P} &6%arg-3% &fis now a slave owner! (%{slave.owners}%)"
- if arg-2 is "list":
- loop {slave.owner::*}:
- message "{@P} &6%loop-value%"
- if arg-1 is "create":
- player command "team reset"
- wait 1 tick
- player command "team man on"
- loop 8 times:
- player command "team create"
- wait 1 tick
- player command "team leave"
- wait 1 tick
- player command "team man off"
- if arg-1 is "start":
- if {slave.diamonds} is not set:
- set {slave.diamonds} to 30
- player command "muteall"
- loop all players:
- if {slave.ignore::%loop-player%} is not set:
- if {slave.owner::%loop-player%} is not set:
- set {slave.bidlist::%loop-player%} to loop-player
- set {slave.currentslave} to (random element out of {slave.bidlist::*})
- set {slave.currentbid} to -1
- if {slave.currentslave} is offline:
- loop all players:
- if loop-player has permission "skript.op":
- send "{@P} %{slave.currentslave}% &fis offline" to loop-player
- delete {slave.bidlist::%{slave.currentslave}%}
- set {slave.currentslave} to (random element out of {slave.bidlist::*})
- wait 1 tick
- broadcast "{@P} Bidding started for &6%{slave.currentslave}%&f!"
- console command "warp Slave %{slave.currentslave}%"
- set {slave.bidtimer} to 15
- if arg-1 is "ignore":
- arg-2 is set
- arg-3 is set
- if arg-2 is "add":
- set {slave.ignore::%arg-3%} to true
- message "{@P} &6%arg-3% &fadded to ignore list"
- if arg-2 is "remove":
- delete {slave.ignore::%arg-3%}
- message "{@P} &6%arg-3% &fremoved from ignore list"
- if arg-1 is "diamonds":
- arg-2 is set
- if arg-2 is "set":
- set {slave.diamonds} to arg-3
- message "{@P} Diamonds set to &6%arg-3%"
- if arg-2 is "save":
- loop all players:
- if loop-player has diamonds:
- set {slave.ownerdiamonds::%loop-player%} to amount of diamonds in loop-player's inventory
- broadcast "{@P} Saving &6%amount of diamonds in loop-player's inventory% &fdiamonds for &6%loop-player%&f."
- remove all diamonds from loop-player's inventory
- if arg-2 is "give":
- loop all players:
- if {slave.ownerdiamonds::%loop-player%} is set:
- give loop-player {slave.ownerdiamonds::%loop-player%} of diamonds
- broadcast "{@P} Giving &6%amount of diamonds in loop-player's inventory% &fdiamonds back to &6%loop-player%&f."
- if arg-1 is "reset":
- delete {slave.owners}
- delete {slave.owner::*}
- delete {slave.ignore::*}
- delete {slave.bidlist::*}
- delete {slave.bidtimer}
- delete {slave.currentslave}
- delete {slave.currentbid}
- delete {slave.bidwinner}
- delete {slave.diamonds}
- delete {slave.ownerdiamonds::*}
- message "{@P} Slave market reset"
- if arg-1 is "help":
- message "{@P} /slave create - Create the 8 teams"
- message "{@P} /slave ignore [add/remove] <player> - Ignore player from bidding list"
- message "{@P} /slave owner add <player> - Add slave owners"
- message "{@P} /slave owner list - List the slave owners"
- message "{@P} /slave diamonds set <amount> - Set amount of diamonds for slave owners"
- message "{@P} /slave diamonds [save/give] - Save leftover diamonds to give back when game starts"
- message "{@P} /slave start - Start the bidding of players"
- message "{@P} /slave reset - Reset everything"
- if arg-1 is not set:
- player command "slave help"
- command /bid [<integer>]:
- trigger:
- {slave.bidtimer} is set
- if {slave.owner::%command sender%} is not set:
- message "{@P} &cError, you are not a slave owner"
- stop
- else:
- if {slave.owner::%command sender%} is set:
- if arg-1 is greater than {slave.currentbid}:
- if command sender does not have arg-1 of diamonds:
- message "{@P} &cError, you don't have enough diamonds"
- else:
- broadcast "{@P} &6%command sender% &fbid &6%arg-1% &fdiamonds"
- set {slave.bidwinner} to command sender
- set {slave.currentbid} to arg-1
- if {slave.bidtimer} is less than 5:
- add 5 to {slave.bidtimer}
- else:
- message "{@P} &cError, Invalid bid"
- else:
- message "{@P} &cError, You are not a slave owner!"
- every 1 real second:
- {slave.bidtimer} is set
- remove 1 from {slave.bidtimer}
- if {slave.bidtimer} is 5 or 4 or 3 or 2 or 1:
- broadcast "{@P} Bidding for &6%{slave.currentslave}% &fends in &6%{slave.bidtimer}% &fseconds!"
- if {slave.bidtimer} is 0:
- broadcast "{@P} &6%{slave.bidwinner}% &fhas won the bid for &6%{slave.currentslave}%&f!"
- console command "team join %{slave.bidwinner}% %{slave.currentslave}%"
- teleport {slave.currentslave} to {slave.bidwinner}
- wait 5 ticks
- delete {slave.bidlist::%{slave.currentslave}%}
- delete {slave.currentslave}
- remove {slave.currentbid} of diamonds from {slave.bidwinner}
- delete {slave.bidtimer}
- wait 1 second
- if {slave.bidlist::*} is set:
- broadcast ""
- set {slave.currentslave} to (random element out of {slave.bidlist::*})
- set {slave.currentbid} to -1
- if {slave.currentslave} is offline:
- loop all players:
- if loop-player has permission "skript.op":
- send "{@P} %{slave.currentslave}% &fis offline" to loop-player
- delete {slave.bidlist::%{slave.currentslave}%}
- set {slave.currentslave} to (random element out of {slave.bidlist::*})
- wait 1 tick
- broadcast "{@P} Bidding started for &6%{slave.currentslave}%&f!"
- console command "warp Slave %{slave.currentslave}%"
- set {slave.bidtimer} to 15
- #For emergencies
- command /startbid [<player>]:
- permission: skript.op
- trigger:
- broadcast ""
- set {slave.currentslave} to arg 1
- set {slave.currentbid} to -1
- broadcast "{@P} Bidding started for &6%{slave.currentslave}%&7!"
- console command "warp Slave %{slave.currentslave}%"
- set {slave.bidtimer} to 15
Advertisement
Add Comment
Please, Sign In to add comment