I'm practicing scripting by modding some of the scripts that came with fpsc. I want the switch to only work when the player has acquired a keycard. When the player has that key, use of the switch will open the door beside it. It looks like it should work but it doesn't. Here is what I have. Can anyone point me in the right direction?
;Artificial Intelligence Script
;Header
desc = Switch Activates Door When Key is Used. Door Stays Open
;Triggers
:state=0:hudreset,hudx=50,hudy=70,hudimagefine=gamecoretextlockeddoor.tga,hudname=keydoorprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=50:hudshow=keydoorprompt,hudfadeout=keydoorprompt
:state=10,plrdistwithin=50,plrusingaction=1,plrhaskey=1:state=1,plrsound=$0,activateifused=1,alttexture=1
;End of Script