My script don't work:
\data\actions\scripts\quests\key_100001.lua
\data\actions\lib\lib-key_100001.lua
\data\actions\actions.xml
Please help-me.
\data\actions\scripts\quests\key_100001.lua
Code:
dofile('data/actions/lib/lib-key_100001.lua')
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == itemUid1 then
if getPlayerStorageValue(cid, storage) == FALSE then
doSetItemActionId(woodenKey, 100001)
doPlayerSendTextMessage(cid, msgStyle, msgFound)
setPlayerStorageValue(cid, storage, TRUE)
elseif getPlayerStorageValue(cid, storage) == TRUE then
doPlayerSendTextMessage(cid, msgStyle1, msgEmpty)
elseif item.uid == itemUid2 then
if getPlayerStorageValue(cid, storage) == FALSE then
doSetItemActionId(woodenKey, 100001)
doPlayerSendTextMessage(cid, msgStyle, msgFound)
setPlayerStorageValue(cid, storage, TRUE)
elseif getPlayerStorageValue(cid, storage) == TRUE then
doPlayerSendTextMessage(cid, msgStyle1, msgEmpty)
end
end
end
return TRUE
end
\data\actions\lib\lib-key_100001.lua
Code:
itemUid1 = 35001
itemUid2 = 35002
storage = 100001
itemChest = 2087
msgStyle = MESSAGE_INFO_DESCR
msgFound = "You have found a Wooden Key."
msgEmpty = "It is empty."
woodenKey = doPlayerAddItem(cid, itemChest, 1)
\data\actions\actions.xml
Code:
<action uniqueid="35001" script="quests/key_100001.lua" />
<action uniqueid="35002" script="quests/key_100001.lua" />
Please help-me.