• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Drop items into corps

Warmix

New Member
Joined
Mar 28, 2010
Messages
18
Solutions
1
Reaction score
2
I've replaced standard tfs 1.2 drooploot.lua with this:

LUA:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local container = Container(corpse)
    if not Player(killer) or not container then
        return
    end
    container:addItem(5943, 1)

   return true
end

In corpse after death you cannot find that item. Why is that?
 
Don't need a 'return false' on the place of 'return'?

It desn't matter like in C++. I can remove it:

LUA:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
    local container = Container(corpse)

    container:addItem(5943, 1)

   return true
end

Return error:
LH3DTAC.png


'corpse' is unknown? Why does it return null? Or maybe I cannot use addItem with corpse?
 
Last edited:
Back
Top