How do I spawn a trigger box only after having a variable?

I am trying to spawn a trigger box that will have a delay before killing the player character if they don’t exit the area fast enough, but the player should be able to approach the door without the trigger box activating unless they have a key which will activate a variable.

your trigger box set default to active. or deactive…
then, when u got a key. find the ref of trigger box use get actor by tag, by class, etc. then set to active.