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

RevScripts Problem with quest script

Weteran

New Member
Joined
Sep 13, 2020
Messages
13
Reaction score
3
Hi i have problem with quest console say:

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 ?
 
Hi i have problem with quest console say:


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 ?
Are you sure that's all the error you're getting? 🤔

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 player:getStorageValue(Storage.quest1.Done) ~= 2 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
        return true
    end

    local chest = chests[item:getUniqueId()]
    if not chest then
        return true
    end

    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)
    return true
end

quest1:uid(1002, 1003, 1004)
quest1:register()
 
Are you sure that's all the error you're getting? 🤔

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 player:getStorageValue(Storage.quest1.Done) ~= 2 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
        return true
    end

    local chest = chests[item:getUniqueId()]
    if not chest then
        return true
    end

    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)
    return true
end

quest1:uid(1002, 1003, 1004)
quest1:register()
When i click on chest in game i get error in console
Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>

Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>

Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>
any ideas?
 
Are you sure that's all the error you're getting? 🤔

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 player:getStorageValue(Storage.quest1.Done) ~= 2 then
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'It\'s empty.')
        return true
    end

    local chest = chests[item:getUniqueId()]
    if not chest then
        return true
    end

    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)
    return true
end

quest1:uid(1002, 1003, 1004)
quest1:register()
When i click on chest in game i get error in console
Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>

Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>

Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/quests/demon_oak/quest1.lua:callback
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
.../server/data/scripts/actions/quests/demon_oak/quest1.lua:9: in function <.../server/data/scripts/actions/quests/demon_oak/quest1.lua:8>
any ideas?
Confirm that Storage -> quest1 exists in your global Storage table.
I confirm this storage in quest_system.lua but is now error in file...
local specialQuests = {
[10544] = Storage.quest1.done,
Lua Script Error: [Scripts Interface]
/home/crixu/server/data/scripts/actions/other/others/quest_system1.lua
...rver/data/scripts/actions/other/others/quest_system1.lua:3: attempt to index field 'quest1' (a nil value)
stack traceback:
[C]: in function '__index'
...rver/data/scripts/actions/other/others/quest_system1.lua:3: in main chunk
quest_system1.lua [error]
Can You explain me how i need to do this ? becuase I'm down now to level NOOB xD
 
Last edited:
Back
Top