execute if score keys timer matches 4 run tag @e[tag=gatedoor] add gateunlock
execute as @e[tag=gatedoor,tag=gateunlock] at @s run function survivalplus:finale/gateunlocking
execute as @e[tag=gatekey,tag=redkey] at @s if block ~ ~1 ~ chiseled_nether_bricks run tag @s add keyunlock
execute as @e[tag=gatekey,tag=yellowkey] at @s if block ~ ~1 ~ chiseled_nether_bricks run tag @s add keyunlock
execute as @e[tag=gatekey,tag=greenkey] at @s if block ~ ~1 ~ chiseled_nether_bricks run tag @s add keyunlock
execute as @e[tag=gatekey,tag=bluekey] at @s if block ~ ~1 ~ chiseled_nether_bricks run tag @s add keyunlock
execute as @e[tag=gatekey,tag=keyunlock] at @s run function survivalplus:finale/keyunlock