there are several methods, for example :
void EntityFun()
{
// wait until skill1 of the entity isn't zero anymore !
while(my.skill1 == 0)
{
wait(1);
}
// destroy entity here..
...
}
and when you want to 'activate' the function again, simply change the skill1 one of the entity to a value not equal zero !
but you could of course work with events, the way you should choose to accomplish this, pretty much depends on the circumstance, when the function should be 'activated' and when 'deactivated' (for example when it hits a wall or something like that !)