function hit_event(local_laserball_number)
{
if (event_type == EVENT_BLOCK)
{
effect(laserball_explo_effect,15,my.x,normal);
laserball_effect_destroy(my.skill33); //use instance number stored in skill33
wait(1);
ent_remove(me);
}
if (event_type == EVENT_ENTITY)
{
effect(laserball_explo_effect,15,my.x,normal);
laserball_effect_destroy(my.skill33); //use instance number stored in skill33
wait(1);
ent_remove(me);
}
}
action laserball
{
wait(1); //always a good idea on any action
my.skill33 = 1; //for storing instance number skill 1 to 40 is available below version A6.2
//skills 1 to 100 is available at or above version A6.2
my.INVISIBLE = ON;
my.ENABLE_BLOCK = ON;
my.ENABLE_ENTITY = ON;
my.EVENT = hit_event(my.skill33);
while (my != NULL)
{
c_move(me, laserball_move, NULLVECTOR, ACTIVATE_TRIGGER|GLIDE);
wait(1);
}
}