• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Read looted items - trigger, when item x is looted

Fermantor

Active Member
Joined
Dec 16, 2009
Messages
209
Solutions
4
Reaction score
33
Location
Germany
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
Lua:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    if corpse:getItemCountById(10521) >= 1 then
        print("Moon Backpack looted!")
    end
    return true
end
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
Lua:
corpse:getEmptySlots()
it always said 10, even if the item dropped.

Any ideas?
 
Back
Top