How do I check when if a player dies during a specific time frame?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Cynacol

New Member
Jul 14, 2022
6
0
1
I have highlighted the part of the code I want to detect whether someone dies during with #HERE IS WHERE IT BEGINS/ENDS. I want to detect if the player dies while that part of the code is executing, and if they do, then to stop that code from running. I have no idea how to do this however.

Code:
command /testscp035:
    trigger:
        set {035warning.%player%} to false
        
every 1 tick:
    loop all players:
        if loop-player's tool is player head named "&8[&x&E&E&1&1&1&1SCP-035&8]":
            if {035warning.%loop-player%} is false:
                set {035warning.%loop-player%} to true
                send action bar "&7&lBe careful." to loop-player
                


on right click:
    if player's tool is player head named "&8[&x&E&E&1&1&1&1SCP-035&8]":
#HERE IS WHERE IT BEGINS
        set {035.%player%} to player's tool with enchants flag hidden
        set {item035_1} to unbreakable leather tunic named "&8[&x&E&E&1&1&1&1SCP-035 Suit&8]" with all flags hidden
        set {item035_2} to unbreakable leather pants named "&8[&x&E&E&1&1&1&1SCP-035 Suit&8]" with all flags hidden
        set {item035_3} to unbreakable leather boots named "&8[&x&E&E&1&1&1&1SCP-035 Suit&8]" with all flags hidden
        dye {item035_1} (255, 255, 255)
        dye {item035_2} (255, 255, 255)
        dye {item035_3} (255, 255, 255)
        enchant {035.%player%} with curse of binding
        enchant {item035_1} with curse of binding
        enchant {item035_2} with curse of binding
        enchant {item035_3} with curse of binding
        apply nausea to the player for 3 seconds
        apply blindness to the player for 3 seconds
        apply slowness of tier 255 to the player for 3 seconds
        send action bar "&oWHAT HAVE YOU DONE..." to player
        clear player's inventory
        set player's helmet to {035.%player%}
        set player's chestplate to {item035_1}
        set player's leggings to {item035_2}
        set player's boots to {item035_3}
        apply regeneration of tier 2 to the player for 1 minute
        apply poison to the player for 10000 minutes
        wait 10 seconds
        apply nausea to the player for 10000 minutes
        apply slowness to the player for 10000 minutes
        wait 20 seconds
        loop 10 times:
            wait 5 seconds
            send "&4You feel that death is drawing ever nearer..."
        kill the player
#HERE IS WHERE IT ENDS
        




on disconnect:
    set {035warning.%player%} to false
 
count how many times the player has died, set a temporary variable to the amount at that time, check if the global variable = the temporary variable
 
count how many times the player has died, set a temporary variable to the amount at that time, check if the global variable = the temporary variable
could you provide an example of how i could do this? also i have to stop that code from running if the player does die and do other specific actions too
 
On death:
Add 1 to {whatanoob::%player’s uuid}

Command e:
Trigger:
set {_noobness} to {whatanoob::%player’s uuid%}
Wait 5 seconds
If {_noobness} != {whatanoob::%player’s uuid}:
message 69*69+69/69^69