I need to find out what I am doing wrong here. My goal is to make a script that performs as so... When you get into distance of the weapon, a HUD pops up. When you get far away from it, it fades out. When you are close to it, you can press "F" to pick up the weapon and the HUD will go away. For some reason, I cannot achieve all of this. I can make the HUD pop in and out depending on distance, but I cannot add a pickup feature. I can make the HUD pop up, and allow the weapon to be picked up, but when I walk away from the weapon, the HUD does not fade out.
Here is my script.
;Artificial Intelligence Script
;Header
desc = Pick F to pick up Colt 45
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pickedupaweapon.tga,hudname=weaponprompt,hudhide=1,hudmake=display,state=13
:state=0:hudreset,hudx=50,hudy=70,hudimagefine=gamecore\text\Deltayo Weap Pickup\pickupcolt45.tga,hudname=weaponpickup,hudhide=1,hudmake=display,state=11
:state=11,plrdistwithin=60:hudshow=weaponpickup,state=12
:state=12,plrdistfurther=60:hudfadeout=weaponpickup,state=11
:state=13,plrdistwithin=60,scancodekeypressed=33:state=1,playertake,setframe=0,plrsound=audiobank\items\pickupweapon.wav,hudshow=weaponprompt,hudfadeout=weaponprompt,hudunshow=weaponpickup,sound=$0
;End of Script