Ok so I will show you how to make
A creature spawn two creatures in
diff spots according to The npc
that died’s location.
First lets register this event
We will need this code
RegisterUnitEvent (989898, 4, "RottingCadaver_OnDied")
Change the989898to what the main npcs spawn id is
Change the RottingCadaver to the name of the mob.
Now place it at the bottom and lets leave it alone
For now. Next up is amking the function itself
With this code it will work
function RottingCadaver_OnDied (pUnit, Event)
end
Yet again we need to change the
“RottingCadaver” to the name of the npc.
Now lets add the coding between the function
And the end commands. This is the coding I
Will start you off with for now. Leave everything
But what I have colored alone.
x = pUnit:GetX ()
y = pUnit:GetY ()
z = pUnit:GetZ ()
o = pUnit:GetO ()
pUnit:SpawnCreature (10925, x, y, z, o, 21, 360000)
x = x + 1
pUnit:SpawnCreature (10925, x, y, z, o, 21, 360000)
Change the10925 to the npc spawn number
Change the21to the faction you want the new npc to have
Change the360000to how long untill it despawns (in milliseconds)
This is what it should look like when you are done with it
function RottingCadaver_OnDied (pUnit, Event)
x = pUnit:GetX ()
y = pUnit:GetY ()
z = pUnit:GetZ ()
o = pUnit:GetO ()
pUnit:SpawnCreature (10925, x, y, z, o, 21, 360000)
x = x + 1
pUnit:SpawnCreature (10925, x, y, z, o, 21, 360000)
<optinal> add any other events you want to happen after
npc dies right here <end option>
end
RegisterUnitEvent (989898, 4, "RottingCadaver_OnDied")
I hope this helps anyone I personaly used this to
Make two smaller blobs appear after main one dies