Here is it:
Code:
entity* ghostobject;
var isplaceobject = 1;
function spawn()
{
	while(isplaceobject != 0)
	{
	temp.x = mouse_pos.x;
	temp.y = mouse_pos.y;
	temp.z = 0;
	
	vec_set(target,temp);
	target.z = 10000;
	
	vec_for_screen(temp,view_build);
	vec_for_screen(target,view_build);
	
	if(c_trace(temp,target,IGNORE_ME | IGNORE_PASSABLE) > 0)
	{
		if(mouse_left)
		{
			ent_create("crate.mdl",target,null);
			if(ghostobject != NULL)
			{
				ent_remove(ghostobject);
				isplaceobject = 0;
			}	
		}
		if(ghostobject == NULL)
		{
			ghostobject = ent_create("crate.mdl",target,NULL);
			ghostobject.transparent = on;
			ghostobject.passable = on;
			ghostobject.alpha = 30;
		}
		else
		{
			vec_set(ghostobject.x,target);
		}
		wait(1);
	}	

	}
	

}



That only works once... then the ghost disappears and you cant spawn another crate.