I tried it and it seems to work.
If you enter a Trigger Zone you hear a soundfile and get a key.
Here is what i did:
1.
I made a key and named it
KeyInvisible.
2.
I attached this
Init script to it:
;Artificial Intelligence Script
;Header
desc = Make Item Appear Invisible
;Triggers
:state=0:setalphafade=0,coloff,state=1,runfpidefault=1
;End of Script
It makes the Key appear but makes it invisible.
3.
I attached this
Main script to it:
;Artificial Intelligence Script
;Header
desc = Invisible waiting for activation
:state=0,activated=1:state=1
:state=1:playertake,plrsound=audiobank\misc\ping.wav,state=2
;:state=2:rundecal=5
;Triggers
;End of Script
The script gives the Key to the Player if he enters the Trigger Zone.
I commented one line out because i dont know what
rundecal=5 is good for.
It seems to work without it.
4.
I added a Trigger to the level and attached this
Main script to it:
;Artificial Intelligence Script
;Header
desc = Plr In Zone gets a Key
;Triggers
:state=0,plrwithinzone=1:activateifused=1,state=1
:state=1:state=2,plrsound=audiobank\voices\targetsighted.wav
;End of Script
For the test i used the
targetsighted sound.
You will have to replace that with your sound.
5.
I typed the name of the Key (KeyInvisible) in the
If Used field of the Trigger Zone.
And last a typed the name of the Key (KeyInvisible) in the
Use Key field of the door the key is needed for.
I placed the Key near the Trigger Zone.
It does not matter if it is on the floor or a table because it is invisible and there is no collision.
Hope that helps.