25.07.2010, 12:37
does anyone know how can i add explosion to an object which is moving up and down by script? i want to add explosion / sec
new object; // This is the object which will explode.
object = CreateObject(1049,0,0,0,0,0,0); // Obviously, you'll have to change this to suit yourself.
SetTimer("Explosion",10000,1); // Creates a timer for the object to explode in 10 seconds, and repeats it.
forward Explosion();
public Explosion()
{
new Float:ObjX,Float:ObjY,Float:ObjZ;
GetObjectPos(object,ObjX,ObjY,ObjZ); // Gets the position of the object.
CreateExplosion(ObjX,ObjY,ObjZ,0,25.0); // Creates an explosion at the position we found.
return 1;
}