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

Key_Quests

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
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:
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?
 
glad you use my script but put Unique id: (key id) and action ID: (Key number, must be over 1000) in mapeditor..
EDIT: You can use the script for keys AND items:P
Item quest: Put unique id as (ITEM_ID), leave action ID as 0 or blank

Key quest: Unique ID: (keyID) action id e.g 1337 in mapeditor then the key will get number 1337
 
Last edited:
Did you really make this? It's kinda weird I got the same script and I posted this in some thread last week..
Anyway..
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

<action itemid="CHEST_ID" script="quests/quests.lua"/>
<action itemid="CHEST ID" script="quests/quests.lua"/>

Remember to remove the old quests/quest.lua
 
Last edited:
Back
Top