Lbtg
Intermediate OT User
- Joined
- Nov 22, 2008
- Messages
- 2,306
- Reaction score
- 129
Hello guys i getting this error on quest while player clicks chest
how its set upd
actions.xml
script
can anyone help me out please ?
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/pradziaquests.lua:onUse
data/actions/scripts/quests/pradziaquests.lua:34: attempt to index global 'Storage' (a nil value)
stack traceback:
[C]: in function '__index'
data/actions/scripts/quests/pradziaquests.lua:34: in function <data/actions/scripts/quests/pradziaquests.lua:28>
how its set upd
actions.xml
Lua:
<action fromuid="3000" touid="3023" script="quests/pradziaquests.lua" /> <!-- newbie quests -->
script
Lua:
local chests = {
[3000] = {itemid = 2169, count = 1}, -- time ring
[3001] = {itemid = 2168, count = 1}, -- life ring
[3002] = {itemid = 2165, count = 1}, -- stealth ring
[3003] = {itemid = 3966, count = 1}, -- banana staff
[3004] = {itemid = 2428, count = 1}, -- orchich axe
[3005] = {itemid = 2383, count = 1}, -- spike sword
[3006] = {itemid = 7620, count = 100}, -- mana potion
[3007] = {itemid = 7618, count = 100}, -- health potion
[3008] = {itemid = 2182, count = 1}, -- snakebit rod
[3009] = {itemid = 2190, count = 1}, -- vortex wand
[3010] = {itemid = 2389, count = 1}, -- spear
[3011] = {itemid = 2410, count = 100}, -- throwing knife
[3012] = {itemid = 2513, count = 1}, -- battle shield
[3013] = {itemid = 2457, count = 1}, -- steel helmet
[3014] = {itemid = 2478, count = 1}, -- brass legs
[3015] = {itemid = 3940, count = 1}, -- comoflouge backpack
[3016] = {itemid = 2789, count = 66}, -- brown mushrooms
[3017] = {itemid = 2420, count = 1}, -- machete
[3018] = {itemid = 2186, count = 1}, -- noonlight rod
[3019] = {itemid = 2191, count = 1}, -- wand of dragon breath
[3020] = {itemid = 2399, count = 100}, -- throwing stars
[3021] = {itemid = 2553, count = 1}, -- pick
[3022] = {itemid = 2160, count = 2}, -- crystal coin
[3023] = {itemid = 2521, count = 1}, -- dark shield
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item.uid < 2999 or item.uid >= 3024 then
return false
end
if chests[item.uid] then
if player:getStorageValue(Storage.pradziaquests) == 1 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 itemWeight = itemType:getWeight()
local playerCap = player:getFreeCapacity()
if playerCap >= itemWeight then
local article = itemType:getArticle()
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have found ' .. (#article > 0 and article .. ' ' or '') .. itemType:getName() .. '.')
player:addItem(chest.itemid, chest.count)
player:setStorageValue(Storage.pradziaquests, 1)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. itemType:getName() .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
end
end
end
return true
end
can anyone help me out please ?