Lava Titan
Developer
hey can any1 tell me how to use properly container:hasItem?
I checked luascript.cpp and I dont see any issue in the way I'm using the function...
I tried:
but I keep getting error
I checked luascript.cpp and I dont see any issue in the way I'm using the function...
I tried:
Code:
function onKill(creature, target)
local corpsePos = target:getPosition()
local corpseId = 1987
local itemId = 11304
if Container(corpseId,corpsePos):hasItem(itemId) then
corpsePos:sendMagicEffect(56)
else
corpsePos:sendMagicEffect(CONST_ME_POFF)
end
return true
end
but I keep getting error
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/looteffect.lua:onKill
data/creaturescripts/scripts/looteffect.lua:6: attempt to index a nil value
stack traceback:
[C]: in function '__index'
data/creaturescripts/scripts/looteffect.lua:6: in function <data/creatur
escripts/scripts/looteffect.lua:1>