• 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 Error Creaturescripts

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
201
Reaction score
15
Hi, does anyone know why I have this error in this script?

i used tfs 1.3 otbr

Code:
 [C]: in function '__index'
        ...sts/heart_of_destruction/killtopass/RealityquakeKill.lua:8: in function <...sts/heart_of_destruction/killtopass/RealityquakeKill.lua:5>

Lua Script Error: [Scripts Interface]
/home/forgottenserver/data/scripts/creaturescripts/quests/heart_of_destruction/killtopass/RealityquakeKill.lua:callback
...sts/heart_of_destruction/killtopass/RealityquakeKill.lua:8: attempt to index local 'player' (a nil value)
stack traceback:
        [C]: in function '__index'
        ...sts/heart_of_destruction/killtopass/RealityquakeKill.lua:8: in function <...sts/heart_of_destruction/killtopass/RealityquakeKill.lua:5>

Lua:
local config = {    timeStorage = 14332,
}

local cEvent = CreatureEvent("RealityquakeKill")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    for cid, _ in pairs(creature:getDamageMap()) do
        local player = Player(cid)
        if player:isPlayer() then
            player:setStorageValue(config.timeStorage, 1) -- sets it to 1
        end
    end
    
    
    return true
end

cEvent:register()
 
Back
Top