• 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!

Lua Attempt to index local 'killer_' (a nil value)

MorganaSacani

Active Member
Joined
Sep 20, 2022
Messages
87
Solutions
1
Reaction score
32
I'm having this problem when I summon some monster to help me kill the algorithm's creature.
This is the problem that occurs:
timerEvent: []
callbackId:[]
function: []
error [...br-global\scripts\creaturescripts\monster\mad_knight.lua:66: attempt to index local 'killer_' (a nil value)
stack traceback:
[C]: in function '__index'
...br-global\scripts\creaturescripts\monster\mad_knight.lua:66: in function <...br-global\scripts\creaturescripts\monster\mad_knight.lua:57>]
I will warn you that this is an onDeath function
And here is a part of the algorithm:
Lua:
for cid, damage in pairs(creature:getDamageMap()) do
        -- The 'killer_' variable is for returning all characters involved in the creature's death.
        local killer_ = Creature(cid)
        if killer_:isPlayer() then

Line 66:
if killer_:isPlayer() then
 
Back
Top