Fermantor
Active Member
Hey guys I wanna make a script, if a player loots a rare item (moon backpack for example), he get's an achievement/storagevalue/something.
The problem is, I don't really know how to read the loot from a dead monster. I tried it with
But it seems that in the moment the onDeath triggers, the corpse is still empty and loot is added afterwards. Cause when I just printed
it always said 10, even if the item dropped.
Any ideas?
The problem is, I don't really know how to read the loot from a dead monster. I tried it with
Lua:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
if corpse:getItemCountById(10521) >= 1 then
print("Moon Backpack looted!")
end
return true
end
Lua:
corpse:getEmptySlots()
Any ideas?