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

[help] Quest_reward.lua: Keys

vichoko

Member
Joined
Oct 9, 2008
Messages
130
Reaction score
6
Location
Santiago, Chile
Hello,
i have a problem with the script:
Code:
elseif (item.uid == 1000) then
-- Llave con Action 4231
doPlayerAddItem(cid, 2088, 1, 4231)
doPlayerSave(cid,TRUE)
-- doItemSetAttribute(2088, "actionid", 4231)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Oh... A KEY!")
-- setPlayerStorageValue(cid, item.uid, 1)

I dont know whats wrong, but that give to me a key with aid:0.

What would be the correct form of this script?

Thanks
 
PHP:
elseif (item.uid == 1000) then
-- Llave con Action 4231
doPlayerSave(cid,TRUE)
local key = doPlayerAddItem(cid, 2088, 1)
doItemSetAttribute(key.uid, "actionid", 4231)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Oh... A KEY!")
setPlayerStorageValue(cid, [STORAGE], 1)

for keys use a diferent storage value.
don't use the keyid

change the [STORAGE] for oen value > 15000
 
don't is perfect script

it is:
function onUse(cid, item, frompos, item2, topos)

if item.uid == 1000 and getPlayerStorageValue(cid, 1000) == -1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You have found a key")
key = doPlayerAddItem(cid, 2089, 1) --- Id Of Key
doItemSetAttribute(key, "aid", 3899) --- key number
setPlayerStorageValue(cid, 1000,1) --- storage
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"It is empty.")
end
return 1
end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, 1000) == -1 then
		doCreatureSetStorage(cid, 1000, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a copper key.')
		doItemSetAttribute(doPlayerAddItem(cid, 2089, 1), 'aid', 4231)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'The ' .. getItemInfo(item.itemid).name .. ' is empty.')
	end
	return true
end
 
Back
Top