function GetPlayerNokaut(player: Player): if {nokaut::%{_player}%} is not set: while block under {_player} is air: stop wait 2 ticks set {nokaut::%{_player}%} to true set {nokaut::location::%{_player}%} to {_player}'s location set {_nokaut::duration} to yaml value "Nokaut-Duration" from file "plugins/PimpekNokaut/config.yml" set {_i} to {_nokaut::duration} wait 6 tick MakePlayerPose({_player}) while {nokaut::%{_player}%} is set: if {nokaut::stoptimer::%{_player}%} is not set: send title "&4&lNOKAUT!" with subtitle "&ePozostalo: &c%{_i}%&e Sekund" to {_player} for 21 ticks apply blindness 999 to {_player} for 999 days remove 1 from {_i} if {_i} is less than 1: KillPlayerNokaut({_player}) wait 20 ticks function MakePlayerPose(player: Player): set {nokaut::cmd::%{_player}%} to true execute {_player} command "/lay" clear {nokaut::cmd::%{_player}%} function KillPlayerNokaut(player: Player): if {nokaut::%{_player}%} is set: set {Nokaut::Kill::%{_player}%} to true remove blindness from {_player} kill {_player} clear {nokaut::%{_player}%} clear {nokaut::location::%{_player}%} clear {Nokaut::Kill::%{_player}%} stop send "&4&l>> &cNie Jestes Podczas Nokautu!" to {_player} function BlockPlayerMoveNokaut(player: Player): while {_player} is online: if {nokaut::%{_player}%} is set: if {nokaut::location::%{_player}%} is not set: stop if distance between {_player}'s location and {nokaut::location::%{_player}%} is greater than 0.75: teleport {_player} to {nokaut::location::%{_player}%} MakePlayerPose({_player}) wait 5 ticks function BlockNokautPlayerIntegration(player: Player) :: boolean: if {nokaut::%{_player}%} is set: set {_sounds} to yaml value "Special-Sounds" from file "plugins/PimpekNokaut/config.yml" if {_sounds} is true: play sound "entity.villager.no" to {_player} send "&4&l>> &cNie Mozesz Tego Zrobic Podczas Nokautu!" to {_player} set {_a} to true return {_a} function RevivePlayerNokaut(player: Player, clicked-player: Player): set {_sounds} to yaml value "Special-Sounds" from file "plugins/PimpekNokaut/config.yml" set {_xp} to yaml value "Revive-Required-Level" from file "plugins/PimpekNokaut/config.yml" set {_revive-duration} to yaml value "Revive-Duration" from file "plugins/PimpekNokaut/config.yml" set {_revive-duration} to {_revive-duration}/2.09 while {_player} is sneaking: if {nokaut::%{_clicked-player}%} is set: if level of {_player} is greater than or equal to {_xp}: loop all players in radius 2 around {_player}: if loop-player is {_clicked-player}: set {nokaut::stoptimer::%{_clicked-player}%} to true add 2 to {_revive::%{_clicked-player}%} if {_sounds} is true: play sound "block.bamboo.place" to {_player} and {_clicked-player} send title "&aReanimowanie... &e%{_revive::%{_clicked-player}%}%&e%%" with subtitle " " to {_player} for 1 second send title "&aReanimowanie... &e%{_revive::%{_clicked-player}%}%&e%%" with subtitle " " to {_clicked-player} for 1 second if {_revive::%{_clicked-player}%} is greater than 99: set {_xp-player} to level of {_player} set level of {_player} to {_xp-player} - {_xp} if {_sounds} is true: play sound "entity.experience_orb.pickup" to {_player} and {_clicked-player} send title "&aPomyslnie Podniesiono: &e%{_clicked-player}%" to {_player} for 3 second send title "&aOcudzono Przez: &e%{_player}%" with subtitle "&3Kliknij Shifta Aby Wstac!" to {_clicked-player} for 3 second clear {nokaut::%{_clicked-player}%} remove blindness from {_clicked-player} clear {nokaut::location::%{_clicked-player}%} clear {nokaut::stoptimer::%{_clicked-player}%} stop else: send "&4&l>> &eNie Posiadasz Odpowiedniego Levelu Wymagany: &6%{_xp}%" to {_player} if {_sounds} is true: play sound "entity.ender_dragon.hurt" to {_player} stop loop wait "%{_revive-duration}% ticks" parsed as timespan clear {nokaut::stoptimer::%{_clicked-player}%} function NokautNewVersion(p: player): if text from "https://pastebin.com/raw/T8r0i0yF" is not "1.0": wait 10 ticks if {_p} have permission "pimpeknokaut.notify" or "pimpeknokaut.*": send "&f==============================================" to {_p} send "&a&lNokaut Have New Version! Download From: " to {_p} send "&f==============================================" to {_p} play sound "block.anvil.place" to {_p} function NokautFiles(): set yaml value "Nokaut-Duration" from file "plugins/PimpekNokaut/config.yml" to 60 set yaml value "Revive-Duration" from file "plugins/PimpekNokaut/config.yml" to 10 set yaml value "Revive-Required-Level" from file "plugins/PimpekNokaut/config.yml" to 5 set yaml value "Special-Sounds" from file "plugins/PimpekNokaut/config.yml" to true on damage of player: if {nokaut::%victim%} is not set: if (victim's health - final damage) is less than or equal to 0.5: cancel event GetPlayerNokaut(victim) stop if {nokaut::%victim%} is set: if {nokaut::Kill::%victim%} is not set: cancel event if {nokaut::%attacker%} is set: if {nokaut::Kill::%attacker%} is not set: cancel event on mine: if BlockNokautPlayerIntegration(Player) is true: cancel event stop loop all players in radius 2 around event-block: if {nokaut::%loop-player%} is set: cancel event send "&4&l>> &cNie Mozesz Kopac Blokow Wokol Gracza Z Nokatuem!" to player on command: if command is "lay" or "swim" or "sit": if {nokaut::cmd::%player%} is set: stop else: cancel event on join: NokautNewVersion(player) BlockPlayerMoveNokaut(Player) on drop: if BlockNokautPlayerIntegration(Player) is true: cancel event on pickup: if BlockNokautPlayerIntegration(Player) is true: cancel event on quit: if BlockNokautPlayerIntegration(Player) is true: KillPlayerNokaut(Player) on jump: if BlockNokautPlayerIntegration(Player) is true: cancel event on script load: NokautFiles() on right click on player: player is sneaking set {_clicked-player} to clicked entity RevivePlayerNokaut(Player, {_clicked-player}) command /zakceptujsmierc []: trigger: KillPlayerNokaut(Player)