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?
quest.lua file
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
-
1667055938087.png1.1 MB · Views: 5 · VirusTotal