09:39 You have found a wooden key.
09:40 You see a wooden key (Key:0).
It weighs 1.00 oz.
09:40 It is empty.
Script1:
Script2:
Items.XML:
Help?
09:40 You see a wooden key (Key:0).
It weighs 1.00 oz.
09:40 It is empty.
Script1:
PHP:
function onUse(cid, item, frompos, item2, topos)
prize = item.uid
aid = item.actionid
local key = doCreateItemEx(prize)
if prize > 0 and prize < 7000 then
queststatus = getPlayerStorageValue(cid,prize)
if queststatus == -1 then
if aid > 1000 then
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
setPlayerStorageValue(cid,prize,1)
doSetItemActionId(key, aid)
doPlayerAddItemEx(cid, key)
else
doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
doPlayerAddItem(cid,prize,1)
setPlayerStorageValue(cid,prize,1)
end
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
else
return 0
end
end
Script2:
PHP:
<action itemid="1740" script="quests/key_quests.lua"/>
<action itemid="1747" script="quests/key_quests.lua"/>
<action itemid="1748" script="quests/key_quests.lua"/>
<action itemid="1749" script="quests/key_quests.lua"/>
Items.XML:
PHP:
<item id="2087" article="a" name="wooden key">
<attribute key="type" value="key"/>
<attribute key="weight" value="100"/>
</item>
Help?