Hello, good, this error is showing up straight in my distro and so far I could not identify what the cause of it ... Does anyone have any solution? My tfs is 1.2
This is error:
This is onDestroyItem function on actions.lua:
and this is the destroy.lua:
If anyone can help me I thank you !
This is error:
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/other/destroy.lua:onUse
data/actions/lib/actions.lua:89: attempt to call method 'isItem' (a nil value)
stack traceback:
[C]: in function 'isItem'
data/actions/lib/actions.lua:89: in function <data/actions/lib/actions.lua:88>
(...tail calls...)
This is onDestroyItem function on actions.lua:
Code:
function onDestroyItem(player, item, fromPosition, target, toPosition, isHotkey)
if not target or not target:isItem() then
return false
end
if target:hasAttribute(ITEM_ATTRIBUTE_UNIQUEID) or target:hasAttribute(ITEM_ATTRIBUTE_ACTIONID) then
return false
end
if toPosition.x == CONTAINER_POSITION then
player:sendCancelMessage(Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
return true
end
local targetId = target.itemid
local destroyId = ItemType(targetId):getDestroyId()
if destroyId == 0 then
return false
end
if math.random(7) == 1 then
local item = Game.createItem(destroyId, 1, toPosition)
if item ~= nil then
item:decay()
end
-- Against The Spider Cult (Spider Eggs)
if targetId == 7585 then
local eggStorage = player:getStorageValue(Storage.TibiaTales.AgainstTheSpiderCult)
if eggStorage >= 1 and eggStorage < 5 then
player:setStorageValue(Storage.TibiaTales.AgainstTheSpiderCult, math.max(1, eggStorage) + 1)
end
Game.createMonster("Giant Spider", Position(33181, 31869, 12))
end
-- Move items outside the container
if target:isContainer() then
for i = target:getSize() - 1, 0, -1 do
local containerItem = target:getItem(i)
if containerItem then
containerItem:moveTo(toPosition)
end
end
end
target:remove(1)
end
toPosition:sendMagicEffect(CONST_ME_POFF)
return true
end
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
return onDestroyItem(player, item, fromPosition, target, toPosition, isHotkey)
end
If anyone can help me I thank you !