function PagodaLaser(x,y,xmov,ymov,scale,angle,prerotation,postrotation,maxwidth,color,delay,del) {
	let objHitbox = CreateStraightLaserA1(x,y,angle,1000,maxwidth*(5/4),del+45,1,delay);
	PagodaBeam;
	return objHitbox;
	
	task PagodaBeam {
		let objLaser1 = ObjPrim_Create(OBJ_SPRITE_2D);
		let objLaser2 = ObjPrim_Create(OBJ_SPRITE_2D);
		let objDetail = ObjPrim_Create(OBJ_SPRITE_2D);
		let objFire = ObjPrim_Create(OBJ_SPRITE_2D);
		let objFire2 = ObjPrim_Create(OBJ_SPRITE_2D);
		
		let width = 2;
		let length = 0;
		let fire_scale = 1.2*scale;
		let fire_scale2 = 0.8*scale;
		let fire_count = 0;
		let detail_count = 0;
		let newangle = angle;
		let newX = x;
		let newY = y;
				
		Obj_SetVisible(objHitbox,false);
		
		ObjRender_SetBlendType(objLaser1, BLEND_ALPHA);
		Obj_SetRenderPriorityI(objLaser1, 28);
		ObjPrim_SetTexture(objLaser1, GetCurrentScriptDirectory ~ "img/PagodaLaser.png");
		ObjSprite2D_SetSourceRect(objLaser1, 0, 37, 256, 69);
		ObjSprite2D_SetDestRect(objLaser1, 0.5, -16, 256.5*2, 16);
		ObjRender_SetColor(objLaser1,color[0],color[1],color[2]);
		
		ObjRender_SetBlendType(objLaser2, BLEND_ADD_RGB);
		Obj_SetRenderPriorityI(objLaser2, 29);
		ObjPrim_SetTexture(objLaser2, GetCurrentScriptDirectory ~ "img/PagodaLaser.png");
		ObjSprite2D_SetSourceRect(objLaser2, 0, 77, 256, 109);
		ObjSprite2D_SetDestRect(objLaser2, 0.5, -16, 256.5*2, 16);
		
		ObjRender_SetBlendType(objDetail, BLEND_ALPHA);
		Obj_SetRenderPriorityI(objDetail, 29);
		ObjPrim_SetTexture(objDetail, GetCurrentScriptDirectory ~ "img/PagodaLaser.png");
		ObjSprite2D_SetSourceRect(objDetail, 0, 0, 256, 30);
		ObjSprite2D_SetDestRect(objDetail, 0.5, -18, 256.5*2, 18);
		
		ObjRender_SetBlendType(objFire, BLEND_ALPHA);
		Obj_SetRenderPriorityI(objFire, 27);
		ObjPrim_SetTexture(objFire, GetCurrentScriptDirectory ~ "img/PagodaLaser_Fire.png");
		ObjRender_SetColor(objFire,color[0],color[1],color[2]);
		ObjRender_SetScaleXYZ(objFire,fire_scale,fire_scale,1);
		
		ObjRender_SetBlendType(objFire2, BLEND_ADD_RGB);
		Obj_SetRenderPriorityI(objFire2, 30);
		ObjPrim_SetTexture(objFire2, GetCurrentScriptDirectory ~ "img/PagodaLaser_Fire.png");
		ObjRender_SetScaleXYZ(objFire2,fire_scale2,fire_scale2,1);
		
		loop(delay) {
			newangle+=prerotation;
			ObjStLaser_SetAngle(objHitbox,newangle);
			newX+=xmov;
			newY+=ymov;
			ObjMove_SetX(objHitbox,newX);
			ObjMove_SetY(objHitbox,newY);
		
			ObjRender_SetScaleXYZ(objLaser1,2,width/25,0);
			ObjRender_SetPosition(objLaser1,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser1,ObjStLaser_GetAngle(objHitbox));
			
			ObjRender_SetScaleXYZ(objLaser2,2,width/32,0);
			ObjRender_SetPosition(objLaser2,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser2,ObjStLaser_GetAngle(objHitbox));
			
			
			ObjRender_SetScaleXYZ(objDetail,2,width/32,0);
			ObjRender_SetPosition(objDetail,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objDetail,ObjStLaser_GetAngle(objHitbox));
			ObjSprite2D_SetSourceRect(objDetail, 0-detail_count, 0, 256-detail_count, 30);
			ObjSprite2D_SetDestRect(objDetail, 1.5, -18, 257.5, 18);
			
			
			ObjRender_SetPosition(objFire,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire, 1, 1, 123, 127); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire, 129, 1, 255, 127); }
			ObjSprite2D_SetDestRect(objFire, 0.5, -61, 128.5, 61);
			
			ObjRender_SetPosition(objFire2,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire2,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire2, 1, 129, 123, 255); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire2, 129, 129, 255, 255); }
			ObjSprite2D_SetDestRect(objFire2, 0.5, -61, 128.5, 61);
			
			if(Obj_IsDeleted(objHitbox)) {
				Obj_Delete(objLaser1);
				Obj_Delete(objLaser2);
				Obj_Delete(objDetail);
				Obj_Delete(objFire);
				Obj_Delete(objFire2);
			}
			
			fire_count+=0.5;
			detail_count+=12;
			yield;
		}
		loop(20) {
			newangle+=postrotation;
			ObjStLaser_SetAngle(objHitbox,newangle);
			newX+=xmov;
			newY+=ymov;
			ObjMove_SetX(objHitbox,newX);
			ObjMove_SetY(objHitbox,newY);
		
			ObjRender_SetScaleXYZ(objLaser1,2*(length/500),width/25,1);
			ObjRender_SetPosition(objLaser1,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser1,ObjStLaser_GetAngle(objHitbox));
			
			ObjRender_SetScaleXYZ(objLaser2,2*(length/500),width/32,0);
			ObjRender_SetPosition(objLaser2,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser2,ObjStLaser_GetAngle(objHitbox));
			
			
			ObjRender_SetScaleXYZ(objDetail,2,width/32,0);
			ObjRender_SetPosition(objDetail,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objDetail,ObjStLaser_GetAngle(objHitbox));
			ObjSprite2D_SetSourceRect(objDetail, 0-detail_count, 0, 256-detail_count, 30);
			ObjSprite2D_SetDestRect(objDetail, 0.5, -18, 256.5*2, 18);
			
			
			ObjRender_SetPosition(objFire,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire, 1, 1, 123, 127); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire, 129, 1, 255, 127); }
			ObjSprite2D_SetDestRect(objFire, 0.5, -61, 128.5, 61);
			
			ObjRender_SetPosition(objFire2,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire2,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire2, 1, 129, 123, 255); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire2, 129, 129, 255, 255); }
			ObjSprite2D_SetDestRect(objFire2, 0.5, -61, 128.5, 61);
			
			if(Obj_IsDeleted(objHitbox)) {
				Obj_Delete(objLaser1);
				Obj_Delete(objLaser2);
				Obj_Delete(objDetail);
				Obj_Delete(objFire);
				Obj_Delete(objFire2);
			}
			
			length+=500/20;
			width+=(maxwidth-2)/20;
			fire_count+=0.5;
			detail_count+=12;
			yield;
		}
		
		loop(del) {
			newangle+=postrotation;
			ObjStLaser_SetAngle(objHitbox,newangle);
			newX+=xmov;
			newY+=ymov;
			ObjMove_SetX(objHitbox,newX);
			ObjMove_SetY(objHitbox,newY);
		
			ObjRender_SetScaleXYZ(objLaser1,2*(length/500),width/25,1);
			ObjRender_SetPosition(objLaser1,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser1,ObjStLaser_GetAngle(objHitbox));
			
			ObjRender_SetScaleXYZ(objLaser2,2*(length/500),width/32,0);
			ObjRender_SetPosition(objLaser2,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser2,ObjStLaser_GetAngle(objHitbox));
			
			
			ObjRender_SetScaleXYZ(objDetail,2,width/32,0);
			ObjRender_SetPosition(objDetail,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objDetail,ObjStLaser_GetAngle(objHitbox));
			ObjSprite2D_SetSourceRect(objDetail, 0-detail_count, 0, 256-detail_count, 30);
			ObjSprite2D_SetDestRect(objDetail, 0.5, -18, 256.5, 18);
			
			
			ObjRender_SetPosition(objFire,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire, 1, 1, 123, 127); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire, 129, 1, 255, 127); }
			ObjSprite2D_SetDestRect(objFire, 0.5, -61, 128.5, 61);
			
			ObjRender_SetPosition(objFire2,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire2,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire2, 1, 129, 123, 255); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire2, 129, 129, 255, 255); }
			ObjSprite2D_SetDestRect(objFire2, 0.5, -61, 128.5, 61);
			
			if(Obj_IsDeleted(objHitbox)) {
				Obj_Delete(objLaser1);
				Obj_Delete(objLaser2);
				Obj_Delete(objDetail);
				Obj_Delete(objFire);
				Obj_Delete(objFire2);
			}
			
			fire_count+=0.5;
			detail_count+=12;
			yield;
		}
		
		loop(30) {
			newangle+=postrotation;
			ObjStLaser_SetAngle(objHitbox,newangle);
			newX+=xmov;
			newY+=ymov;
			ObjMove_SetX(objHitbox,newX);
			ObjMove_SetY(objHitbox,newY);
		
			ObjShot_SetIntersectionEnable(objHitbox,false);
		
			ObjRender_SetScaleXYZ(objLaser1,2,width/25,1);
			ObjRender_SetPosition(objLaser1,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser1,ObjStLaser_GetAngle(objHitbox));
			
			ObjRender_SetScaleXYZ(objLaser2,2,width/32,0);
			ObjRender_SetPosition(objLaser2,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objLaser2,ObjStLaser_GetAngle(objHitbox));
			
			
			ObjRender_SetScaleXYZ(objDetail,2,width/32,0);
			ObjRender_SetPosition(objDetail,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objDetail,ObjStLaser_GetAngle(objHitbox));
			ObjSprite2D_SetSourceRect(objDetail, 0-detail_count, 0, 256-detail_count, 30);
			ObjSprite2D_SetDestRect(objDetail, 0.5, -18, 256.5, 18);
			
			
			ObjRender_SetScaleY(objFire,fire_scale*(width/32));
			ObjRender_SetPosition(objFire,ObjMove_GetX(objHitbox),ObjMove_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire, 1, 1, 123, 127); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire, 129, 1, 255, 127); }
			ObjSprite2D_SetDestRect(objFire, 0.5, -61, 128.5, 61);
			
			ObjRender_SetScaleY(objFire2,fire_scale2*(width/32));
			ObjRender_SetPosition(objFire2,ObjMove_GetX(objHitbox),ObjRender_GetY(objHitbox),0);
			ObjRender_SetAngleZ(objFire2,ObjStLaser_GetAngle(objHitbox));
			if(fire_count%2==0) { ObjSprite2D_SetSourceRect(objFire2, 1, 129, 123, 255); }
			else if(fire_count%2==1) { ObjSprite2D_SetSourceRect(objFire2, 129, 129, 255, 255); }
			ObjSprite2D_SetDestRect(objFire2, 0.5, -61, 128.5, 61);
			
			if(Obj_IsDeleted(objHitbox)) {
				Obj_Delete(objLaser1);
				Obj_Delete(objLaser2);
				Obj_Delete(objDetail);
				Obj_Delete(objFire);
				Obj_Delete(objFire2);
			}
			
			width-=(maxwidth+2)/30;
			fire_count+=0.5;
			detail_count+=12;
			yield;
		}
		Obj_Delete(objLaser1);
		Obj_Delete(objLaser2);
		Obj_Delete(objDetail);
		Obj_Delete(objFire);
		Obj_Delete(objFire2);
	}
}