Hi
Solved. There where two issues:
1. The manual says about PLAYERTAKE: "The entity’s main script will continue to run if the entity is defined as Always Active"
2. After waiting for a key beeing pressed, its best to wait for it to be released
Here is the modified code that works:
;Artificial Intelligence Script
desc = Press F key to pick up
;If player presses F key, weapon will be picked up, and added to player's weapon inventory. If player presses F key again, weapon will be dropped, and removed from player`s invetory.
;Triggers
:state=0:alwaysactive=1
:state=0:hudreset,hudx=50,hudy=90,hudsize=18,hudtext=Press F to pick up this weapon,hudname=WEAPONPROMPT,hudhide=1,hudmake=display,state=10
:state=10,plrdistwithin=40:hudshow=WEAPONPROMPT,state=12
:state=12,plrdistfurther=40:hudunshow=WEAPONPROMPT,state=12,state=10
;Player Press F key
:state=12,keypressed=33 1:hudunshow=WEAPONPROMPT,playertake,coloff,rundecal=-1,plrsound=audiobank\items\pickupweapon.wav,state=13
:state=13,keypressed=33 0:state=14
;Player Press F key again
:State=14,keypressed=33 1:playerdropcurrent,removecurrentweapon,state=15
:state=15,keypressed=33 0:state=16
:state=16,plrdistfurther=45:state=10
;End of Script
Greetings, Snake67
------------------------------------------------------------
i5 2.8 GHz 64bit / 4G ram / W7 home sp1 / geforce gts 250
FPSC 120 Beta 3