function Create(self) self.timer = Timer(); --this is the timer I use for the cooldown time between two strikes, it is also used for health regeneration self.healtime = 500 --this is the time needed to heal 1 health point, this is also the time needed to generate 1 power point self.power = 1; --this is used to determine wether or not the strike is ready, and what intensity it will have(the more power the more bombs will fall) end function Destroy(self) end function Update(self) if self.timer:IsPastSimMS(self.healtime) and self.Health > 0 then --every 500ms ( self.healtime ), and if the unit still lives if self.Health < 100 then --if it is injured, then regenerate a health point self.Health = self.Health + 1; end --if the power is not to the maximum(15 here, can be anything you want), then generate another power point if self.power < 15 then self.power = self.power + 1; end self.timer:Reset(); end if self:IsPlayerControlled() == true and (UInputMan:KeyPressed(38) or UInputMan:KeyPressed(35)) and self.power > 0 then --if the unit is controlled by the player and if num1 or 8 is pressed, then while self.power > 0 do --while the unit has sufficient power local e = CreateMOPixel("Rifle HE"); --create the MOPixel called "Rifle HE" (not vanilla, located in Triclon Empire.rte/Weapons/Rifle/Rifle.ini), it can be whatever you want, just make sure to write the right ClassName(MOSRotating, MOPixel, MOSParticle...etc) if self.HFlipped == true then --if the unit is flipped(facing left), then e.Vel = Vector(math.random(-85,-20),math.random(40,85)); --set the X velocity of e (the bomb we created earlier) to a random number between -85 and -20 (that way it will go left, if you want the bombs to hit closer from one another, reduce the difference between the numbers(for example -50 and -40, higner values will make the bombs hit further away from your actor) and set Y the velocity to a random number between 40 and 85(in cc positive velocity makes things move towards the ground), e.Vel.X and e.Vel.Y can also be used if you don't want to use a vector (for example e.Vel.X = math.random(-85,-20);) e.Pos.X = self.Pos.X - (35 + math.random(-25,50)); --set the X position of the bomb to the X position of the actor +35 + a random number between -25 and 50, that way the bombs won't appear all on the same spot. e.Pos.Y = 10 + math.random(-10,10); --set the Y position of the bomb to 10 + a random number between -10 and +10 (in CC 0 is the top of the screen) else --if the actor is facing right, do the same with opposite X velocities and positions e.Vel = Vector(math.random(20,85),math.random(40,85)); e.Pos.X = self.Pos.X + (35 + math.random(-25,50)); e.Pos.Y = 10 + math.random(-10,10); end MovableMan:AddMO(e); --finally, add the bomb to the game self.power = self.power -1; --decrease power by 1, that way it will drop 1 bomb for 1 power point(so a maximum of 15, they will all drop at the same time since we used while) end end if self:IsPlayerControlled() == true and (UInputMan:KeyPressed(39) or UInputMan:KeyPressed(36)) and self.power > 3.5 then --same as before with other bombs and num2 or 9 while self.power > 4.5 do --these bombs are bigger so they cost more power(4.5) local e = CreateMOSRotating("Triclon Uber Shell"); --these bombs are MOSRotatings, they are located in Triclon Empire.rte/Actors/Conqueror/Conqueror.ini if self.HFlipped == true then e.Vel = Vector(math.random(-85,-20),math.random(40,85)); e.Pos.X = self.Pos.X - (35 + math.random(-25,50)); e.Pos.Y = 10 + math.random(-10,10); else e.Vel = Vector(math.random(20,85),math.random(40,85)); e.Pos.X = self.Pos.X + (35 + math.random(-25,50)); e.Pos.Y = 10 + math.random(-10,10); end MovableMan:AddMO(e); self.power = self.power - 4.5; --these bombs are bigger so they cost more power(4.5) end end end