task Taskname(your parameters){
//define whatever you need (often, a time counter) and put any code you need here
let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,some x, some y);
ObjShot_SetGraphic(obj, bullet id);
ObjMove_SetAngle(obj, some angle);
ObjMove_SetSpeed(obj, some speed);
//etc. (delay, fade, bomb resist ...)
ObjShot_Regist(obj);
while(GetLife>0 && !Obj_IsDeleted(obj)){ //you'll usually want the bullet to disappear when the current nonspell/spell ends, and the task to end when the bullet is deleted (eg by a bomb)
yield; //don't forget that little one : it pauses this task in order to let the other tasks advance too
//put what the bullet does every frame here.
}
Obj_Delete(obj); // if you got out of the loop because life was under 0, delete the bullet.
//put other aftereffects here if any.
}
Try to understand the following task, as an example.
task EDivShot(x,y,a,g,d,k){
let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjShot_SetGraphic(obj,g);
ObjMove_SetAngle(obj,a);
ObjMove_SetSpeed(obj,0);
ObjShot_Regist(obj);
let t=0;
while(GetLife>0 && !Obj_IsDeleted(obj)){
t++;
yield;
if(t==d){CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a-60,0.05,1.5,g+1,0);
CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),0,a+60,0.05,1.5,g+1,0);}
if(t==d+60){ObjMove_SetAngle(obj,a+k);}
if(t>=d+60){ObjMove_SetSpeed(obj,(t-(d+60))*0.01);}
}
Obj_Delete(obj);
}