scoreboard players add @s KyuDummy 1
execute as @s[scores={KyuDummy=1}] run scoreboard players set @s KyuDummy2 60
execute at @s[scores={KyuDummy=10..19}] run tellraw @a[distance=..75] ["",{"text":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","color":"yellow","italic":"false"}]
execute at @s[scores={KyuDummy=10..19}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ERROR","color":"red","obfuscated":"true"}]
execute at @s[scores={KyuDummy=20..29}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ER","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"},{"text":"OR","color":"red","obfuscated":"true"}]
execute at @s[scores={KyuDummy=30..39}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"E","color":"red","obfuscated":"false"},{"text":"R","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"},{"text":"OR","color":"red","obfuscated":"true"}]
execute at @s[scores={KyuDummy=40..49}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"E","color":"red","obfuscated":"false"},{"text":"R","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"},{"text":"O","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"}]
execute at @s[scores={KyuDummy=50..59}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ER","color":"red","obfuscated":"false"},{"text":"R","color":"red","obfuscated":"false"},{"text":"O","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"}]
execute at @s[scores={KyuDummy=60..70}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ERROR","color":"red","obfuscated":"false"}]
execute at @s[scores={KyuDummy=10..60}] run playsound minecraft:ui.button.click ambient @a[distance=..75] ~ ~ ~ 0.05 0.75 0.05


#text alert timer
execute as @s[scores={KyuDummy=70..}] run scoreboard players add @s KyuDummy6 1
execute at @s[scores={KyuDummy6=1}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ATTENTION - PLAYER \"","color":"red","obfuscated":"false"},{"selector":"@p[tag=PushedSelfDestruct]","color":"red","italic":"false"},{"text":"\" HAS DOOMED THE SACRED TOMB. EVACUATE IMMEDIATELY.\n","color":"red","obfuscated":"false"}]
execute at @s[scores={KyuDummy6=16}] run execute as @e[limit=25] run tellraw @a[distance=..75] ["",{"text":"ATTENTION - PLAYER \"","color":"dark_red","obfuscated":"false"},{"selector":"@p[tag=PushedSelfDestruct]","color":"dark_red","italic":"false"},{"text":"\" HAS DOOMED THE SACRED TOMB. EVACUATE IMMEDIATELY.\n","color":"dark_red","obfuscated":"false"}]
execute as @s[scores={KyuDummy6=30..}] run scoreboard players set @s KyuDummy6 0







#tellraw @s ["",{"text":"","color":"white"},{"selector":"@a[tag=!SelfTagGrave,gamemode=!spectator,limit=1,sort=random]","color":"white","italic":"false"},{"text":"","color":"white"},{"text":" was overrun by zombies.","color":"white","italic":"false"}]
#execute as @s[scores={KyuDummy=1}] run tellraw @a[distance=..75] ["",{"text":"ER","color":"red","obfuscated":"false"},{"text":"AA","color":"red","obfuscated":"true"},{"text":"R","color":"red","obfuscated":"false"},{"text":"A","color":"red","obfuscated":"true"}]



#timer for changing subtitle countdown
scoreboard players add @s[tag=!GoBoomy] KyuDummy3 1
execute as @s[scores={KyuDummy3=1}] run scoreboard players remove @s KyuDummy2 1
execute at @s[scores={KyuDummy3=1},tag=!GoBoomy] run title @a[distance=..75] subtitle [{"color":"red","score":{"name":"@s","objective":"KyuDummy2"}},{"text":" seconds until complete obliteration.","color":"red","underlined":false}]
execute as @s[scores={KyuDummy3=20..}] run scoreboard players set @s KyuDummy3 0


#timer for the title fade in/out
scoreboard players add @s[tag=!GoBoomy] KyuDummy4 1
execute at @s[scores={KyuDummy4=1}] run title @a[distance=..75] times 26 20 26
execute at @s[scores={KyuDummy4=1}] run title @a[distance=..75] title [{"text":"WARNING: ","color":"dark_red","underlined":false},{"text":"SELF-DESTRUCT SEQUENCE INITIATED","color":"red","underlined":false}]
execute at @s[scores={KyuDummy4=1}] run playsound minecraft:entity.skeleton_horse.death hostile @a[distance=..75] ~ ~5000 ~ 1500 0.5 1
execute as @s[scores={KyuDummy4=70..}] run scoreboard players set @s KyuDummy4 0


execute at @s run execute as @a[distance=..70,gamemode=adventure] run function zzzzdonotuse:minutetimer/specialplayertags
execute at @s run execute as @a[distance=..70,gamemode=adventure] run gamemode survival
execute at @s[tag=!GoBoomy] run execute as @e[type=tnt,distance=..60] run data merge entity @s {Fuse:60}





#go boom after the countdown is complete
tag @s[scores={KyuDummy2=..0}] add GoBoomy
execute as @s[tag=GoBoomy] run execute at @s positioned ~ ~-10 ~-12 run fill ~-5 ~-5 ~-5 ~5 ~5 ~5 air replace ender_chest
kill @s[type=marker,tag=GoBoomy]


#goboom counter
scoreboard players add @s[tag=GoBoomy] KyuDummy5 1





#execute at @s[scores={KyuDummy=1}] run playsound minecraft:entity.skeleton_horse.death hostile @a[distance=..75] ~ ~5000 ~ 1500 0.5 1
#execute at @s[scores={KyuDummy=1}] run tellraw @a[distance=..75] ["",{"text":":WARNING: SELF-DESTRUCT SEQUENCE INITIATED.","color":"#FFD52E"}]

#execute as @e[type=marker,limit=1,sort=nearest,tag=KyuBigPyramid] run execute at @s run fill ~-10 ~-10 ~-10 ~10 ~10 ~10 air replace ancient_debris
