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