Thats still all wrong. It may work by chance but will likely crash later. Here is the right code.

function pickup()
{
if(event_type = EVENT_CLICK);
{
ent_remove(me);
}}

action key() //apply to key bit map(on floor in my case)
{
set(my,OVERLAY);
my.emask |= ENABLE_CLICK;
my.event = pickup;
}

Dont assign an entity to a BMAP* pointer and dont set the SHOW flag for a level entity!