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

Lua Key with actionID in bag as reward from quest?

Michaeel

New Member
Joined
Mar 6, 2009
Messages
272
Reaction score
1
Hello, i wanto to make quest with rewards in bag but when i put key with actionID it doesn't work.

Code:
function onUse(cid, item, frompos, item2, topos)
	if item.uid == 62457 then
		if getPlayerStorageValue(cid,62457) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a bag.")
			local bag = doPlayerAddItem(cid,1987,1)
			doAddContainerItem(bag,2202,1)
			doAddContainerItem(bag,2151,2)
			doAddContainerItem(bag,2229,1)
			doAddContainerItem(bag,2230,1)
[B]		        doAddContainerItem(bag,2091,1)
			doItemSetAttribute(aid, 59874)[/B]
			setPlayerStorageValue(cid,62457,1)	
		else
			doPlayerSendTextMessage(cid,25,"This chest is empty. You've already done this quest!")
		end
	
	end
	return TRUE
end

2091 - key's ID
59874 - key's actionID
console:
Code:
(luaDoItemSetAttribute) Item not found
what's wrong?
 
Code:
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid,62457) < 1 then
		doPlayerSendTextMessage(cid, 25, "You have found a bag.")
		local bag = doPlayerAddItem(cid, 1987, 1)
		doAddContainerItem(bag, 2202, 1)
		doAddContainerItem(bag, 2151, 2)
		doAddContainerItem(bag, 2229, 1)
		doAddContainerItem(bag, 2230, 1)
		local key = doAddContainerItem(bag, 2091, 1)
		doItemSetAttribute(key, "aid", 59874)
		setPlayerStorageValue(cid, 62457, 1)	
	else
		doPlayerSendTextMessage(cid, 25, "The chest is empty.")
	end
	return true
end
 
Back
Top