As Quadraxas stated, the code won't work as you have it written in most cases.

Think more like this code, hit the U key and see what happens.

Code:
#define Health    skill20

action my_action()
{
	my.Health = 100;
 	my_function();
	while (my.Health > 0)
	{
		...
                if(key_U)
		{
			my.Health = 0;
		}

		wait(1);
	}
        ent_remove(my);
} 

function my_function()
{
 	PANEL* pan = pan_create(...);
	while (my != NULL)
	{
		...
		wait(1);
	}
	pan_remove(pan);
}



Think that is more what you was trying to do.

Loco


Professional A8.30
Spoils of War - East Coast Games