DeathNote.sk

Created by FinalPlayer024

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

#░█▀▀▀█ █─█ █▀▀█ ─▀─ █▀▀█ ▀▀█▀▀ ░█▀▀█ █▀▀ ▀▀█▀▀ 
#─▀▀▀▄▄ █▀▄ █▄▄▀ ▀█▀ █──█ ──█── ░█─▄▄ █▀▀ ─░█── 
#░█▄▄▄█ ▀─▀ ▀─▀▀ ▀▀▀ █▀▀▀ ──▀── ░█▄▄█ ▀▀▀ ─░█── 
#Script creato da @FinalPlayer024, t.me/SkriptGeT
#Script made by @FinalPlayer024, t.me/SkriptGeT

#Opzioni - Options
options:

  main_command: DeathNote

  use_permission: true
  permission_to_use_DeathNote: DeathNote.sk

  kira_can_kill_himSelf: true

  default_chatFormat: &7%player%&8: &7%message%
  kira_chatFormat: &8Kira: &7%message%
  
  default_seconds: 40

  #Se vuoi cambiare la lingua, scrivi "/DeathNote setlang"
  #If you want to change your language, type "/DeathNote setlang"



#[READ ME]#

#Modifica il codice sotto solo se sai cosa stai facendo, altrimenti modifica solo le options in alto, per cambiare lingua
#dello script, basta scrivere in chat "/DeathNote setlang"

#Change the code below only if you know what you are doing, otherwise change only the options above, if you want to change
#the language of the script, just type "/DeathNote setlang"








#IL CODICE PARTE DA QUI
#CODE STARTS HERE

function changeLanguage(t: text):
  set {DeathNote::currentLanguage} to "%{_t}%"

  {_t} is "en" or "english" or "inglese" or "england":
    broadcast "&0» &7DeathNote language switched to EN!"

  {_t} is "it" or "italiano" or "italian" or "italia":
    broadcast "&0» &7Lingua del DeathNote cambiata in IT!"

  make console execute command "sk reload %script%"

#If you want to translate the script, just change the option to "language: it"
#Se vuoi tradurre lo script in inglese, modifica l'opzione in "language: en"
on load:
  
  make console execute command "gamerule sendCommandFeedback false"
  make console execute command "gamerule showDeathMessages false"

  {DeathNote::currentLanguage} is not set:

    set {DeathNote::currentLanguage} to "it"

  "%{DeathNote::currentLanguage}%" = "it":

    set {DeathNote::language::Regole::1} to "&71. &0L'umano il cui nome sarà scritto su questo quaderno morirà.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::2} to "&72. &0Questo quaderno non avrà effetto a meno che chi scrive non abbia in mente il volto della persona mentre scrive il suo nome. Quindi eventuali omonimi non verranno colpiti.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::3} to "&73. &0Se la causa della morte viene scritta entro {@default_seconds} secondi dopo aver scritto il nome della persona, questa si verificherà.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::4} to "&74. &0Se la causa della morte non è specificata, la persona di cui si scrive il nome morirà di arresto cardiaco.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::5} to "&75. &0Dopo aver scritto la causa della morte, i dettagli della stessa dovranno essere scritti nei seguenti 6 minuti e 40 secondi.%last character of nl%&c[Non funzionante!]%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::6} to "&76. &0Prima o poi tutti gli esseri umani muoiono, senza alcuna eccezione.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::7} to "&77. &0Dopo la loro morte, vi è il nulla (Mu).%last character of nl%%last character of nl%"
    
    set {DeathNote::language::RandomShinigami} to "&cCasuale"

    set {DeathNote::language::You} to "TU"

    set {DeathNote::language::Confirm} to "&0» &7Vuoi uccidere"
    set {DeathNote::language::ConfirmSuicide} to "te stesso?"

    set {DeathNote::language::SpecifiedArg} to "&0» &7Specifica 'reload' o 'setlang'."
    set {DeathNote::language::ReloadComplete} to "&0» &7Reload eseguito con successo!"

    set {DeathNote::language::SomeoneFound} to "&8Qualcuno ha trovato il DeathNote... è nato un nuovo Kira!"

    set {DeathNote::language::NoteOfDeathGod} to "||&7Il quaderno del Dio della Morte"

    set {DeathNote::language::SpecifyDeathCause} to "&0» &7Specifica la causa della morte tra &8""&7suicidio&8""&7, &8""&7infarto&8""&7, &8""&7caduta&8""&7, &8""&7fulmine&8""&7.%last character of nl%%last character of nl%Se non verrà specificata la causa della morte entro {@default_seconds} secondi, l'umano cui nome è stato scritto, morirà di arresto cardiaco."

    set {DeathNote::language::Heart::1} to "&7AIUTO! Non mi sento bene!"
    set {DeathNote::language::Heart::2} to "&7AIUTATEMI! Il cuore!!"
    set {DeathNote::language::Heart::3} to "&7Argh.. Il mio... cuore..."
    set {DeathNote::language::Heart::4} to "&7&oha avuto un attacco di cuore..."

    set {DeathNote::language::Suicide::1} to "&7BASTA! QUESTO MONDO FA SCHIFO!!"
    set {DeathNote::language::Suicide::2} to "&7Addio, mondo crudele!"
    set {DeathNote::language::Suicide::3} to "&7Non mi seguite! ADDIO!"
    set {DeathNote::language::Suicide::4} to "&7&osi è suicidato per mano di Kira..."

    set {DeathNote::language::Fall::1} to "&7Come.. come sono finito qui su?!"
    set {DeathNote::language::Fall::2} to "&7HEY! Cosa ci faccio qui su??"
    set {DeathNote::language::Fall::3} to "&7AIUTO! Sto per cadere!"
    set {DeathNote::language::Fall::4} to "&7&oè caduto da un posto molto alto..."

    set {DeathNote::language::Lightning::1} to "&7&oè stato colpito da un fulmine..."

    set {DeathNote::language::SuicideCause::1} to "&0» &7E suicidio sia!"
    set {DeathNote::language::SuicideCause::2} to "&8Suicidio"
    set {DeathNote::language::SuicideCause::3} to "||&7Ti suiciderai per mano di Kira."

    set {DeathNote::language::HeartCause} to "morirà a seguito di un arresto cardiaco!"

    set {DeathNote::language::FallCause} to "cadrà da un posto molto alto!"

    set {DeathNote::language::LightningCause} to "verrà colpito da un fulmine!"

    set {DeathNote::language::ANewKira} to "&8Un nuovo Kira è in possesso del DeathNote."

    set {DeathNote::language::NoPermissionToUseDeathNote} to "&8L'attuale possessore del DeathNote non ti permette di usare il quaderno della morte."
 
    set {DeathNote::language::KiraDied} to "&8Kira è morto..."

  "%{DeathNote::currentLanguage}%" = "en":

    set {DeathNote::language::Regole::1} to "&71. &0The human, whose name is written in this note, shall die.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::2} to "&72. &0This note will not take effect unless the writer has the person's face in their mind when writing his/her name. Therefore, people sharing the same name will not be affected.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::3} to "&73. &0If the cause of death is written within {@default_seconds} seconds of writing the person's name, it will happen.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::4} to "&74. &0If the cause of death is not specified, the person will simply die of a heart attack.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::5} to "&75. &0After writing the cause of death, details of the death should be written in the next 6 minutes and 40 seconds.%last character of nl%&c[It doesn't work!]%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::6} to "&76. &0All humans, without exception, eventually die.%last character of nl%%last character of nl%"
    set {DeathNote::language::Regole::7} to "&77. &0After they die, the place they go is Mu (Nothingness).%last character of nl%%last character of nl%"

    set {DeathNote::language::RandomShinigami} to "&cCasuale"

    set {DeathNote::language::You} to "YOU"

    set {DeathNote::language::Confirm} to "&0» &7Do you really want to kill"
    set {DeathNote::language::ConfirmSuicide} to "yourself?"

    set {DeathNote::language::SpecifiedArg} to "&0» &7Specify 'reload' or 'setlang'."
    set {DeathNote::language::ReloadComplete} to "&0» &7Reload complete!"

    set {DeathNote::language::SomeoneFound} to "&8Someone has found the DeathNote... a new Kira has born!"

    set {DeathNote::language::NoteOfDeathGod} to "||&7Shinigami's Note"

    set {DeathNote::language::SpecifyDeathCause} to "&0» &7Specify the cause of death typing &8""&7suicide&8""&7, &8""&7heart&8""&7, &8""&7fall&8""&7, &8""&7lightning&8""&7.%last character of nl%%last character of nl%If the death cause will not be specified in the next {@default_seconds} seconds, the human whose name is written, will die from a heart attack."

    set {DeathNote::language::Heart::1} to "&7HELP ME! I don't feel so good!"
    set {DeathNote::language::Heart::2} to "&7MY HEART!! IT HURTS!"
    set {DeathNote::language::Heart::3} to "&7Argh.. My... heart..."
    set {DeathNote::language::Heart::4} to "&7&odied due to a heart attack..."

    set {DeathNote::language::Suicide::1} to "&7STOP IT! THIS WORLD SUCKS!!"
    set {DeathNote::language::Suicide::2} to "&7Goodbye, cruel world..."
    set {DeathNote::language::Suicide::3} to "&7Leave me alone! GOODBYE!"
    set {DeathNote::language::Suicide::4} to "&7&osuicided thanks to Kira..."

    set {DeathNote::language::Fall::1} to "&7How.. How am I arrived up here?"
    set {DeathNote::language::Fall::2} to "&7HEY! What the ##@?##@ am I doing here??"
    set {DeathNote::language::Fall::3} to "&7HELP ME! I'm about to fall down!"
    set {DeathNote::language::Fall::4} to "&7&ohit the ground too hard..."

    set {DeathNote::language::Lightning::1} to "&7&ohas been killed by a lightning..."

    set {DeathNote::language::SuicideCause::1} to "&0» &7And it will be SUICIDE!"
    set {DeathNote::language::SuicideCause::2} to "&8Suicide"
    set {DeathNote::language::SuicideCause::3} to "||&7Kira told you to suicide... NOW EXECUTE!"

    set {DeathNote::language::HeartCause} to "will die due to a heart attack!"

    set {DeathNote::language::FallCause} to "will hit the ground too hard!"

    set {DeathNote::language::LightningCause} to "will be killed by a lightning!"

    set {DeathNote::language::ANewKira} to "&8A new Kira has taken the DeathNote."

    set {DeathNote::language::NoPermissionToUseDeathNote} to "&8The owner of this book doesn't allow you to use it."
 
    set {DeathNote::language::KiraDied} to "&8Kira died..."





#Some function
#Delle funzioni
function beKira(p: player):
  set {DeathNote::owner} to "%{_p}%"

  "%{DeathNote::lastowner}%" is not "%{_p}%":

    broadcast "%{DeathNote::language::ANewKira}%"

  wait 5 ticks

  strike fake fake lightning at location of {_p}

function noMoreKira(p: player):
  clear {DeathNote::owner}
  set {DeathNote::lastowner} to "%{_p}%"

function DeathNote(p: player):
  set {DeathNote::lastComponents::*} to ""

  set {DeathNote::book} to a new written book

  set {_1} to a new text component with "%{DeathNote::language::Regole::1}%"
  set {_2} to a new text component with "%{DeathNote::language::Regole::2}%"

  add text component {_1} and {_2} to book {DeathNote::book}

  set {_3} to a new text component with "%{DeathNote::language::Regole::3}%"
  set {_4} to a new text component with "%{DeathNote::language::Regole::4}%"

  add text component {_3} and {_4} to book {DeathNote::book}

  set {_5} to a new text component with "%{DeathNote::language::Regole::5}%"
  set {_6} to a new text component with "%{DeathNote::language::Regole::6}%"

  add text component {_5} and {_6} to book {DeathNote::book}

  set {_7} to a new text component with "%{DeathNote::language::Regole::7}%"

  add text component {_7} to book {DeathNote::book}

  loop all players:

    loop-player is {_p}:
      set {_player} to a new text component with "- &7%loop-player% &c[%{DeathNote::language::You}%]%last character of nl%"
      add {_player} to {DeathNote::lastComponents::*}

      "{@kira_can_kill_himSelf}" = "true":

        add hover event with action SHOW_TEXT with text "%{DeathNote::language::Confirm}% %{DeathNote::language::ConfirmSuicide}%?" to text component {_player}
        add click event with action RUN_COMMAND with execute "/choose__Death__Cause %loop-player%" to text component {_player}

    loop-player is not {_p}:
      set {_player} to a new text component with "- &7%loop-player%%last character of nl%"
      add {_player} to {DeathNote::lastComponents::*}
      
      add hover event with action SHOW_TEXT with text "%{DeathNote::language::Confirm}% %loop-player%?" to text component {_player}
      add click event with action RUN_COMMAND with execute "/choose__Death__Cause %loop-player%" to text component {_player}

  add text component {DeathNote::lastComponents::*} to book {DeathNote::book}

#Main command
#Comando principale
command /{@main_command} [<text>] [<text>]:
  aliases: /note
  trigger:
    DeathNote(player)

    arg 1 is set:

      arg 1 is not "reload" or "setlanguage" or "lang" or "setlang":

        send "%{DeathNote::language::SpecifiedArg}%" to player
        stop

      arg 1 is "reload":

        send "%{DeathNote::language::ReloadComplete}%" to player

      arg 1 is "setlang" or "lang" or "setlanguage":

        arg 2 is set:

          arg 2 is "it" or "italiano" or "italia" or "italian":

            changeLanguage("it")

          arg 2 is "en" or "english" or "inglese" or "england":

            changeLanguage("en")

          stop

        "%{DeathNote::currentLanguage}%" = "it":

          set {DeathNote::currentLanguage} to "en"
          changeLanguage("en")

          stop

        set {DeathNote::currentLanguage} to "it"
        changeLanguage("it")

        stop

      make console execute command "sk reload %script%"
      stop

    broadcast "%{DeathNote::language::SomeoneFound}%"

    set {DeathNote::owner} to "%player%"
    set tablist name of player to "&8Kira"


    {DeathNote::book::Ryuk} is not set:

      give {DeathNote::book} named "&8DeathNote" with lore "%{DeathNote::language::NoteOfDeathGod}%||&cRyuk" to player
      set {DeathNote::book::Ryuk} to true

      stop

    {DeathNote::book::Rem} is not set:

      give {DeathNote::book} named "&8DeathNote" with lore "%{DeathNote::language::NoteOfDeathGod}%||&cRem" to player
      set {DeathNote::book::Rem} to true

      stop

    {DeathNote::book::Shidoh} is not set:

      give {DeathNote::book} named "&8DeathNote" with lore "%{DeathNote::language::NoteOfDeathGod}%||&cShidoh" to player
      set {DeathNote::book::Shidoh} to true

      stop

    give {DeathNote::book} named "&8DeathNote" with lore "%{DeathNote::language::NoteOfDeathGod}%||&c%{DeathNote::language::RandomShinigami}%" to player

    wait 10 seconds

    clear {DeathNote::book::*}

#DO NOT CHANGE THIS!
#NON CAMBIARE QUI!
command /choose__Death__Cause [<player>]:
  trigger:
    make console execute command "gamerule sendCommandFeedback"
    make console execute command "gamerule showDeathMessages false"

    set {DeathNote::chat::%player%} to true

    send "%{DeathNote::language::SpecifyDeathCause}%" to player

    set {DeathNote::lastvictim} to arg 1

    clear {DeathNote::cause::%player%}
    
    wait {@default_seconds} seconds
    
    clear {DeathNote::chat::%player%}

    {DeathNote::cause::%player%} is not set:

      set {_} to a random integer between 1 and 3

      {_} = 1:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::1}%" to all players
      {_} = 2:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::2}%" to all players
      {_} = 3:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::3}%" to all players

      wait 1.5 seconds

      broadcast "&8&o%{DeathNote::lastvictim}% %{DeathNote::language::Heart::4}%"
      kill {DeathNote::lastvictim}
      stop
    
    {DeathNote::cause::%player%} = "Suicidio":

      set {_} to a random integer between 1 and 3

      {_} = 1:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Suicide::1}%" to all players
      {_} = 2:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Suicide::2}%" to all players
      {_} = 3:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Suicide::3}%" to all players
        
      wait 1.5 seconds

      broadcast "&8&o%{DeathNote::lastvictim}% %{DeathNote::language::Suicide::4}%"

    {DeathNote::cause::%player%} = "Cuore":

      set {_} to a random integer between 1 and 3

      {_} = 1:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::1}%!" to all players
      {_} = 2:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::2}%" to all players
      {_} = 3:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Heart::3}%" to all players

      wait 1.5 seconds

      broadcast "&8&o%{DeathNote::lastvictim}% %{DeathNote::language::Heart::4}%"

    {DeathNote::cause::%player%} = "Caduta":

      wait 1.5 seconds

      set block under {DeathNote::lastvictim} to air

      wait 3.3 seconds

      broadcast "&8&o%{DeathNote::lastvictim}% %{DeathNote::language::Fall::4}%"


    {DeathNote::cause::%player%} = "Fulmine":

      wait 1.5 seconds

      broadcast "&8&o%{DeathNote::lastvictim}% %{DeathNote::language::Lightning::1}%"
      strike fake fake lightning at location of {DeathNote::lastvictim}

    kill {DeathNote::lastvictim}
    clear {DeathNote::cause::%player%}

#Chat event 
#Eventi in chat
on chat:

  {DeathNote::chat::%player%} = true:
    cancel event
  
    message contains ("suicidio" or "Suicidio") or ("suicide" or "Suicide"):

      set {DeathNote::cause::%player%} to "Suicidio"
      send "%{DeathNote::language::SuicideCause::1}%" to player

      drop {DeathNote::lastvictim}'s tool at block 2 in front of {DeathNote::lastvictim}

      wait 5 ticks

      set {DeathNote::lastvictim}'s tool to an iron sword named "%{DeathNote::language::SuicideCause::2}%" with lore "%{DeathNote::language::SuicideCause::3}%"
    
    message contains ("infarto" or "Infarto") or ("cuore" or "Cuore") or ("attack" or "Attack") or ("heart" or "Heart"):

      set {DeathNote::cause::%player%} to "Cuore"
      send "&0» &7%{DeathNote::lastvictim}% %{DeathNote::language::HeartCause}%" to player

    message contains ("caduta" or "Caduta") or ("fall" or "Fall"):

      set {DeathNote::cause::%player%} to "Caduta"
      send "&0» &7%{DeathNote::lastvictim}% %{DeathNote::language::FallCause}%" to player

      teleport {DeathNote::lastvictim} 150 blocks above location of {DeathNote::lastvictim}
      set block under {DeathNote::lastvictim} to stone

      set {_} to a random integer between 1 and 3

      {_} = 1:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Fall::1}%" to all players
      {_} = 2:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Fall::2}%" to all players
      {_} = 3:

        send "&7%{DeathNote::lastvictim}%&8: %{DeathNote::language::Fall::3}%" to all players

      set {DeathNote::lastvictim}'s gamemode to SURVIVAL

    message contains ("fulmine" or "Fulmine") or ("lightning" or "Lightning"):

      set {DeathNote::cause::%player%} to "Fulmine"
      send "&0» &7%{DeathNote::lastvictim}% %{DeathNote::language::LightningCause}%!" to player
    clear {DeathNote::chat::%player%}
    stop

  "%player%" = "%{DeathNote::owner}%":

    cancel event
    send "{@kira_chatFormat}" to all players
    stop

  cancel event
  send "{@default_chatFormat}" to all players

#Other useful events
#Altri eventi utili
on pick up:

  name of item is "&8DeathNote"

  beKira(player)
  set tablist name of player to "&8Kira"

on drop:
  
  name of item is "&8DeathNote"

  noMoreKira(player)
  set tablist name of player to "&7%player%"

on rightclick:

  name of player's tool is "&8DeathNote"

  set {DeathNote::owner} to "%player%"
  set tablist name of player to "&8Kira"

  cancel event

  "{@use_permission}" = "true":
  
    player doesn't have permission "{@permission_to_use_DeathNote}":

      send "%{DeathNote::language::NoPermissionToUseDeathNote}%" to player

      drop player's tool at block 2 in front of player

      wait 5 ticks

      remove player's tool from player's inventory

      noMoreKira(player)
      set tablist name of player to "&7%player%"

      stop

  DeathNote(player)
  open book {DeathNote::book} to player

on join:

  DeathNote(player)

  "%player%" = "%{DeathNote::owner}%":
    beKira(player)
    set tablist name of player to "&8Kira"
    stop

  set tablist name of player to "&7%player%"

on quit:

  DeathNote(player)

on death:

  "%victim%" = "%{DeathNote::owner}%":

    broadcast "%{DeathNote::language::KiraDied}%"

    strike fake fake lightning at location of victim

    noMoreKira(player)
    set tablist name of player to "&7%player%"

on store:

  name of event-item is "&8DeathNote"

  noMoreKira(player)
  set tablist name of player to "&7%player%"

on unstore:
  
  name of event-item is "&8DeathNote"

  beKira(player)
  set tablist name of player to "&8Kira"

on item despawn:

  cancel event