• 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+ Tfs 1.2 bug "onDeath"

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
Hi, im using tfs 1.2 for 8.6 and found this bug:
I made one script, when a player kill X monster, player gain Y storage:
Lua:
function onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if killer:isPlayer() then
        killer:setStorageValue(191912, 1)
    end
    return true
end

But have one bug, if you kill the target with only 1 hit, it will generate this error:
Code:
/scripts/tests.lua:2: attempt to index local 'killer' (a nil value

But if you kill with more than 1 hit, the script runs normal, no error.
The error is when the target dies in only 1 hit, it does not generate the "killer", why?
 
Back
Top