Howdy, I don't know exactly how your blood is made, so this script may not work for you. However, I came up with something like this.
The script itself is really simple, and all it does is spawning blood in the enemy's position, and change the color of that blood.
The command itself looks as follows:
C++:
@cmd Blood BLOOD_NAME BLOOD_COLOR X Y
So as you can see, first you have to give the program the name of your blood.
Because I don't know if you use different blood appearances or just the same one for all enemies.
Nevertheless, I decided to add such an option.
Next, you need to define the color of the blood. Because the script changes the color by manipulating the map value.
You need to add more color palettes to your blood entity first.
Finally, you can change the position of the spawned blood. If you see that your blood appears weird and too much on the right side, for example.
Then you can just add, for example, -50 and move it more to the enemy.
Okay, now about the script. It presents itself as follows:
Code:
#define BLOOD1 "..."
#define BLOOD2 "..."
#define BLOOD3 "..."
#define RED 0
#define BLUE 1
#define GREEN 2
void Blood(void Name, int Color, int NewX, int NewY)
{
void Self = getlocalvar("self");
int X = getentityproperty(Self, "x");
int Z = getentityproperty(Self, "z");
void vSpawn;
clearspawnentry();
loadmodel(Name);
setspawnentry("name", Name);
setspawnentry("map", Color);
vSpawn = spawn();
changeentityproperty(vSpawn, "position", X + NewX, Z + NewY, 0);
return vSpawn;
spawn();
}
As you can see, I have added some #define variables. The only change to be made here is to add the blood name after #define BLOOD{#}.
This way you don't have to tell the program the name of the blood in your enemy file, but you can just use #define name. For example, BLOOD1, BLOOD2, etc.
Also, don't forget to kill your blood after it is spawned. You can put @cmd killentity getlocalvar("self") at the end of the animation to kill it.
I hope It will help you
