Auto-translated
Well, it doesn't really help; without them, you can't cast spells properly (for example)... So, I decided on the function and logically implemented it using a delay:But sleep(50) is a whole 10 seconds, and all this happens in 2 seconds... What could be wrong here? Maybe I messed something up :smile39: ?function AttackerCreatureDeath(creatureName)
if GetCreatureType(creatureName) ~= 36 then
AttackerDeathCount = AttackerDeathCount-1;
count = GetCreatureNumber(creatureName);
spawnCount = count/3;
if spawnCount ~= 0 then
local x, y = GetUnitPosition(creatureName);
sleep(50);
removeUnit(creatureName);
sleep(5);
SummonCreature(ATTACKER, 36, spawnCount, x, y);
end;
end;
end;
Added 7 minutes later
By the way, while browsing the common scripts, I came across a function that isn't mentioned in any guide (or maybe I just didn't look hard enough): showMessage(parameter, some number)
If I understand correctly, this command can be used to send a message to the combat log (where it shows who hit whom and for how much).