Hm. Is the key already used for another action?
You can try this:
 Code:
function create_px()
{
while(key_pressed(50) == on)//number of the key, see: manual: key_mapping
{
vec_set(temp,vector(20,0,0));
vec_rotate(temp,(plBiped01_entity.pan);
vec_add(temp,(plBiped01_entity.x);
effect(effect_x, 1, temp, nullvector);

wait (1);
}
}