Hi i have problem with quest console say:
What is wrong i see is function 8 and 10 line but i cant fix that any help ?
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/quest1.lua:10: in function <.../server/data/scripts/actions/quests/quest1.lua:8>
Lua:
local chests = {
[1002] = {itemid = 9928, count = 1},
[1003] = {itemid = 36452, count = 1},
[1004] = {itemid = 25545, count = 1}
}
local quest1 = Action()
function quest1.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if chests[item.uid] then
if player:getStorageValue(Storage.quest1.Done) ~= 2 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
return true
end
local chest = chests[item.uid]
local itemType = ItemType(chest.itemid)
if itemType then
local article = itemType:getArticle()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. (#article > 0 and article .. ' ' or '') .. itemType:getName() .. '.')
end
player:addItem(chest.itemid, chest.count)
player:setStorageValue(Storage.quest1.Done, 3)
end
return true
end
quest1:uid(1002, 1003, 1004)
quest1:register()
What is wrong i see is function 8 and 10 line but i cant fix that any help ?