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()