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

1.5 nekiro chestbox quest problem

OTAmator

Member
Joined
May 4, 2016
Messages
60
Reaction score
8
I make chestbox that should gives steel boots, but it gives gives unique id item (5049) instead of item id (steel boots id 2645) is ? How to fix it?
1667055960308.png1667055984123.png1667056027924.png1667056072883.png

quest.lua file

Lua:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid <= 1250 or item.uid >= 30000 then
        return false
    end

    local itemType = ItemType(item.uid)
    if itemType:getId() == 0 then
        return false
    end

    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()
    if table.contains(annihilatorReward, item.uid) then
        if player:getStorageValue(30015) == -1 then
            if playerCap >= itemWeight then
                if item.uid == 1990 then
                    player:addItem(1990, 1):addItem(2326, 1)
                else
                    player:addItem(item.uid, 1)
                end
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
                player:setStorageValue(30015, 1)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        end
    elseif player:getStorageValue(item.uid) == -1 then
        if playerCap >= itemWeight then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. '.')
            player:addItem(item.uid, 1)
            player:setStorageValue(item.uid, 1)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
        end
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end
 

Attachments

put in uniqueid just the item id
u dont need to add the item anymore inside the chest and actionid 2000 is not required aswell
 
Solution
put in uniqueid just the item id
u dont need to add the item anymore inside the chest and actionid 2000 is not required aswell
What if i want to create two chest quests with the same reward id item?
And how can i put bag with few items to chest quest? Do i have to create lua scripts for that type of quests?
 
What if i want to create two chest quests with the same reward id item?
And how can i put bag with few items to chest quest? Do i have to create lua scripts for that type of quests?
hello mate. Check my thread with advanced quest script for multiple reward

 
Back
Top