Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- P:<blue>[DeathNote]<white>
- kc:<red>[KiraChat]<italic><white>
- nk:You are not Kira!
- kh:<red>[KiraHelp]<italic><white>
- command /deathnote <text>:
- permission:skript.op
- trigger:
- if arg 1 is "enable":
- set {dn} to true
- set {dnplayer} to player
- execute command "/setDNnicks"
- delete {DNl}
- delete {DNkira}
- delete {IsKira::*}
- delete {IsL::*}
- delete {DNfailure::*}
- delete {DNdm::*}
- loop all players:
- set {DNcooldown::%loop-player%} to false
- broadcast "<orange>Death Note has been enabled!"
- else if arg 1 is "disable":
- set {dn} to false
- delete {dnplayer}
- delete {DNnick::*}
- delete {DNl}
- delete {DNkira}
- delete {IsKira::*}
- delete {IsL::*}
- delete {DNfailure::*}
- delete {DNdm::*}
- loop all players:
- set {DNcooldown::%loop-player%} to false
- broadcast "<orange>Death Note has been disabled!"
- execute command "/scoreboard objectives remove ID"
- #------------------------------------------------------------------------------
- #METHODS FOR USE IN MAIN COMMAND
- #------------------------------------------------------------------------------
- #Sets a nick for each player that is a 7 char long integer
- command /setDNnicks:
- permission:skript.op
- trigger:
- loop all players:
- {dn} is true
- execute command "/scoreboard objectives add ID dummy"
- set {DNnick::%loop-player%} to a random integer from 100000 to 999999
- execute command "/scoreboard players set %loop-player% ID %{DNnick::%loop-player%}%"
- #Sets Ls and Kiras.
- command /setDNroles [<int=1>]:
- permission:skript.op
- trigger:
- {dn} is true
- broadcast "{@P} ID's and %arg 1% L and Kira are set per team!"
- execute command "/scoreboard objectives setdisplay belowName ID"
- loop {Teams::*}:
- set {roleOptions::*} to {Team.%loop-value%::*}
- loop arg-1 times:
- set {DNkira} to a random element of {roleOptions::*}
- remove {DNkira} from {roleOptions::*}
- set {HasKira::%loop-index%} to arg 1
- set {DNkiraPlayer} to ("%{DNkira}%" parsed as offlineplayer)
- set {DNkira} to "%{DNkira}%" parsed as player
- set {IsKira::%{DNkira}%} to true
- if {DNkiraPlayer} is online:
- send "{@P} You have become the Kira! Use /khelp to learn about being a Kira!" to {DNkiraPlayer}
- set {DNl} to a random element of {roleOptions::*}
- remove {DNl} from {roleOptions::*}
- set {DNlPlayer} to ("%{DNl}%" parsed as offlineplayer)
- set {DNl} to "%{DNl}%" parsed as player
- set {IsL::%{DNl}%} to true
- if {DNlPlayer} is online:
- send "{@P} You have become L! Discover the Kira and save your team from his wrath!" to {DNlPlayer}
- send "{@P} Hit Kira once to insta-kill him! But be warned, a poor choice will lead to your demise..." to {DNlPlayer}
- if arg 1 is greater than 1:
- loop all players:
- if {IsL::%loop-player%} is true:
- send "{@P} The L's on your team are:" to loop-player
- loop all players:
- {Teams.InTeam::%loop-player-1%} is {Teams.InTeam::%loop-player-2%}
- {IsL::%loop-player-2%} is true
- send "{@P} %loop-player-2%" to loop-player-1
- delete {roleOptions::*}
- command /llist:
- trigger:
- {dn} is true
- player is {dnplayer}
- send "{@kc} L's Alive:" to the player
- loop all players:
- if {IsL::%loop-player%} is true:
- send "{@P} %loop-player%" to player
- #------------------------------------------------------------------------------
- #KIRA COMMANDS
- #------------------------------------------------------------------------------
- command /kcc <text>:
- trigger:
- {dn} is true
- if {IsKira::%player%} is true:
- loop all players:
- if {IsKira::%loop-player%} is true:
- send "{@kc} %player%: %arg 1%" to loop-player
- else:
- send "{@P} {@nk}" to player
- command /kcl:
- trigger:
- {dn} is true
- if {IsKira::%player%} is true:
- loop all players:
- if {IsKira::%loop-player%} is true:
- send "{@kc} %player% is at: X=%player's x coordinate%, Y=%player's y coordinate%, Z=%player's z coordinate%" to loop-player
- else:
- send "{@P} {@nk}" to player
- command /kcp:
- trigger:
- {dn} is true
- if {IsKira::%player%} is true:
- send "{@kc} Kiras Alive:" to the player
- loop all players:
- if {IsKira::%loop-player%} is true:
- send "{@kc} %loop-player%" to player
- else:
- send "{@P} {@nk}" to player
- player is {dnplayer}
- send "{@kc} Kiras Alive:" to the player
- loop all players:
- if {IsKira::%loop-player%} is true:
- send "{@kc} %loop-player%" to player
- command /khelp:
- trigger:
- {dn} is true
- if {IsKira::%player%} is true:
- send "{@kh} Each player has an ID number above their heads that can be seen from only within 10 blocks. You must discover a person's ID in order to use the Death Note to kill them." to player
- send "{@kh} Do /dn <ID> <fire|water|fall|mobs|explosion> to kill players. Each cause of death has special after-effects." to player
- wait 5 seconds
- send "{@kh} Use /kcc <text> to chat with other Kiras, /kcp to learn about the other Kiras, and /kcl to let other Kiras know your location." to player
- send "{@kh} Beware of L! If the L on your team so much as touches you, you will die!" to player
- else:
- send "{@P} {@nk}" to player
- #The Kiras' death note
- command /dn <integer> [<text>]:
- trigger:
- {dn} is true
- {DNcooldown::%player%} is false
- if {IsKira::%player%} is true:
- arg 1 is set
- loop all players:
- if {DNnick::%loop-player%} is arg 1:
- if arg 2 is set:
- {Teams.InTeam::%player%} is {Teams.InTeam::%loop-player%}
- if arg 2 is "explosion":
- send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% blew up"
- create an explosion of power 2 at loop-player
- kill loop-player
- else if arg 2 is "mobs":
- send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {rand} to a random integer from 1 to 5
- if {rand} is 1:
- set {DNdm::%loop-player%} to "%loop-player% was slain by Zombie"
- spawn a zombie at loop-player
- else if {rand} is 2:
- set {DNdm::%loop-player%} to "%loop-player% was shot by Skeleton"
- spawn a skeleton at loop-player
- else if {rand} is 3:
- set {DNdm::%loop-player%} to "%loop-player% was slain by Spider"
- spawn a spider at loop-player
- else if {rand} is 4:
- set {DNdm::%loop-player%} to "%loop-player% was slain by Silverfish"
- spawn 2 silverfish at loop-player
- else if {rand} is 5:
- set {DNdm::%loop-player%} to "%loop-player% was killed by Witch using magic"
- spawn a witch at loop-player
- kill loop-player
- else if arg 2 is "fall":
- send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% fell from a high place"
- execute command "/playsound %loop-player% damage.fallbig"
- loop blocks in radius 2 around loop-player:
- set loop-block to air
- kill loop-player
- else if arg 2 is "fire":
- send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% went up in flames"
- execute command "/playsound %loop-player% fire.fire"
- loop blocks in radius 3 around loop-player:
- chance of 25%:
- loop-block is air
- set loop-block to fire
- kill loop-player
- else if arg 2 is "water":
- send "{@P} %loop-player% will die to %arg 2% in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% drowned"
- loop blocks in radius 3 around loop-player:
- loop-block is air
- set loop-block to water
- kill loop-player
- else:
- send "{@P} %loop-player% will die in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% was killed by a heart attack"
- execute command "/playsound %loop-player% mob.ghast.scream"
- kill loop-player
- else:
- send "{@P} %loop-player% will die in 40 seconds!" to player
- wait 40 seconds
- loop-player is alive
- set {DNdm::%loop-player%} to "%loop-player% was killed by a heart attack"
- execute command "/playsound %loop-player% mob.ghast.scream"
- kill loop-player
- set {DNcooldown::%player%} to true
- send "{@P} You cannot use the Death Note again for 5 minutes!" to player
- wait 5 minutes
- set {DNcooldown::%player%} to false
- send "{@P} The Death Note has cooled down! You can now use it again!" to player
- arg 1 is not set
- send "{@P} Death Note types: fall, water, explosion, mobs, fire" to player
- else:
- send "{@P} {@nk}" to player
- #------------------------------------------------------------------------------
- #OTHER STUFF
- #------------------------------------------------------------------------------
- on damage of player:
- {dn} is true
- attacker is a player
- if {IsL::%attacker%} is true:
- if {Teams.InTeam::%attacker%} is {Teams.InTeam::%victim%}:
- attacker's tool is air
- if {IsKira::%victim%} is true:
- victim is alive
- set {DNfailure::%victim%} to true
- wait a tick
- kill the victim
- else:
- {HasKira::%{Teams.InTeam::%attacker%}%} is greater than 0
- set {DNfailure::%attacker%} to true
- wait a tick
- kill the attacker
- on death of player:
- {dn} is true
- if {IsKira::%victim%} is true:
- subtract 1 from {HasKira::%{Teams.InTeam::%victim%}%}
- execute command "/team leave %victim%"
- if {DNfailure::%victim%} is true:
- if {IsKira::%victim%} is true:
- set death message to "<white><bold>Kira <red>%victim% <white><bold>was successfully killed by L!"
- else if {IsL::%victim%} is true:
- set death message to "<white><bold>L <aqua>%victim% <white><bold>failed to kill Kira and died!"
- else if {DNdm::%victim%} is set:
- set death message to "%{DNdm::%victim%}%"
- set {IsKira::%victim%} to false
- set {IsL::%victim%} to false
- on join:
- {dn} is true
- if {IsKira::%player%} is true:
- send "{@P} You are Kira! Use /dn <ID> <cause> to kill players!" to player
- else if {IsL::%player%} is true:
- send "{@P} You are L! Save your team by eliminating the Kira!" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement