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

adrenyslopez

Member
Joined
Dec 22, 2015
Messages
201
Reaction score
15
Hello someone helps me with this error of scripts, does not grant the storage and gives me this error


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




Lua:
local config = {    timeStorage = 36994,
}

local cEvent = CreatureEvent("FugueKill")
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()
 
Solution
Hello someone helps me with this error of scripts, does not grant the storage and gives me this error


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




Lua:
local config = {    timeStorage = 36994,
}

local cEvent = CreatureEvent("FugueKill")
function cEvent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified...
Hello someone helps me with this error of scripts, does not grant the storage and gives me this error


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




Lua:
local config = {    timeStorage = 36994,
}

local cEvent = CreatureEvent("FugueKill")
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()
change
Lua:
if player:isPlayer() then
to
Lua:
if player then
 
Solution
Back
Top