If anyone's interested in the finished script, here it is.
I may add a blue particle effect in the centre for the realism, at a later date.
PHP Code:
//#CLIENTSIDE
function onCreated() {
hideimgs(200, 100000);
this.indexn = 200;
onTimeout();
}
function onMouseDown(var) {
if (var == "left") {
this.mode = "on";
Spark();
}
}
function onMouseUp(var) {
if (var == "left") {
this.mode = "off";
emitter.destroy();
emitter.removeparticles();
emitter.removemodifiers();
}
}
function onTimeout() {
if (this.mode == "on") {
this.indexn += 1;
showimg(this.indexn, "g4_particle_sun.png", mousex - 2, mousey - 2);
findimg(this.indexn).zoom = random(0.2, 0.3);
findimg(this.indexn).red = 1;
findimg(this.indexn).green = 1;
findimg(this.indexn).blue = 1;
findimg(1000000).x = findimg(this.indexn).x + 1.2;
findimg(1000000).y = findimg(this.indexn).y + 0.8;
with(findimg(1000000)) {
emitter.emit();
}
}
settimer(0.05);
}
function Spark() {
with(findimg(1000000)) {
spin = degtorad(0);
rotation = degtorad(0);
with(emitter) {
delaymin = 0.01;
delaymax = 0.01;
nrofparticles = 3;
emitautomatically = false;
autorotation = true;
firstinfront = true;
emissionoffset = {
0, 0, 0
};
attachposition = false;
checkbelowterrain = false;
continueafterdestroy = false;
maxparticles = 100000;
particleTypes = 1;
with(particles[0]) {
image = "g4_animation_fire.gif";
zoom = 0.25;
red = 1;
green = 1;
blue = 1;
alpha = 1;
mode = 1;
lifetime = 0.6;
angle = degtorad(32);
zangle = degtorad(0);
speed = 30;
rotation = degtorad(0);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 1;
stretchy = 1;
sound = "none.wav";
layer = 2;
}
addlocalmodifier("once", 0, 0, "angle", "replace", degtorad(0), degtorad(360)); // Sparks
addlocalmodifier("range", 0.25, 0.5, "alpha", "replace", 0.99, 0); // SparkFadeOut
}
}
}
Have fun ARC Welding pixels to other pixels!