• 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 Advanced Quest Chest Help

Badoo

New Member
Joined
May 6, 2012
Messages
19
Reaction score
1
hey guys im back i havent found a post i need a quest chest
based on your level basicly when you click it at lvl 100 u get
a lvl 100 mana rune and when u click it at level 200 u get a lvl 200 manarune etc...please and ty and another quest i cant get to work..
thanks for viewing and thanks for helping me if you do i never forget to rep++ when it is due.
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {
	level = 80,
	storage = 4050
	}
local items = {
	item_1 = {2520,1},	
	item_2 = {2466,1}
	}
		-- MSG  Config -----------------------------------------------------------------------------------------------------------------
		msgEmpty = "It is empty."
		--------------------------------------------------------------------------------------------------------------------------------
	if getPlayerStorageValue(cid,config.storage) == -1 or getPlayerLevel(cid,config.level)then
   			doPlayerAddItem(cid,items.item_1)
			doPlayerAddItem(cid,items.item_2)
			setPlayerStorageValue(cid,config.storage,1)
			end
			else
   		 doPlayerSendTextMessage(cid,21,msgEmpty)
   	end
   	return TRUE
end
 
try this :)
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local items = { 
		item_1 = {{2520,1}, {6140}, {100}}, -- Manaruneitemid, count, storage, level
		item_2 = {{2466,1}, {6141} {200}}
    } 
	
	if(getPlayerStorageValue(cid, items.item_1[2]) < 0) then
		if(getPlayerLevel(cid) == items.item_1[3]) then
			doPlayerAddItem(cid, items.item_1[1][1], items.item_1[1][2])
			setPlayerStorage(cid, items.item_1[3], 1)
		else
			doPlayerSendCancel(cid, "You have to reach lv. ".. items.item_1[3] .." to claim this item.")
		end
	elseif(getPlayerStorageValue(cid, items.item_2[2]) < 0) then
		if(getPlayerLevel(cid) == items.item_2[3]) then
			doPlayerAddItem(cid, items.item_2[1][1], items.item_2[1][2])
			setPlayerStorage(cid, items.item_2[3], 1)
		else
			doPlayerSendCancel(cid, "You have to reach lv. ".. items.item_2[3] .." to claim this item.")
		end
	else
		doPlayerSendCancel(cid, "It's is empty.")
		return false
	end
	return true
end
 
thanks for the reply so quicky just loaded it it seems i get this error

PHP:
[09/06/2012 17:02:36] [Error - Action Interface] 
[09/06/2012 17:02:36] data/actions/scripts/quests/behe/reward.lua:onUse
[09/06/2012 17:02:36] Description: 
[09/06/2012 17:02:36] data/actions/scripts/quests/behe/reward.lua:12: attempt to concatenate field '?' (a table value)
[09/06/2012 17:02:36] stack traceback:
[09/06/2012 17:02:36] 	data/actions/scripts/quests/behe/reward.lua:12: in function <data/actions/scripts/quests/behe/reward.lua:1>
 
Back
Top