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

Solved Help with this quest script

gunmetal

New Member
Joined
Oct 15, 2007
Messages
75
Reaction score
0
I have this quest chest set up for poi rewards, if i use the chest it opens like a regular chest and its empty, i have the unique ids set.
Do i need to set an action id as well? rep to whoever can solve this!






PHP:
	config = {
		storage = 5010,
		items = { --     id,count
			item_1 = {2453,1},  -- arcane staff
			item_2 = {6528,1},  -- avenger
			item_3 = {5803,1},  -- arbalest
		}
	}

function onUse(cid, item, frompos, item2, topos)

   	if getPlayerStorageValue(cid,config.storage) == -1 then
   		if item.uid == 6001 then
			newItem = config.items.item_1[1]
			count = config.items.item_1[2]
   		elseif item.uid == 6002 then
			newItem = config.items.item_2[1]
			count = config.items.item_2[2]
   		elseif item.uid == 6003 then
			newItem = config.items.item_3[1]
			count = config.items.item_3[2]
		end

		-- MSG  Config -----------------------------------------------------------------------------------------------------------------
		msgEmpty = "It is empty."
		msgGetItem = "You have found "..getItemArticleById(newItem).." "..getItemNameById(newItem).."."
		msgNoCap = "You have found a "..getItemNameById(newItem).." weighing "..getItemWeightById(newItem,count).." oz it is too heavy."
		--------------------------------------------------------------------------------------------------------------------------------

		if getPlayerFreeCap(cid) >= getItemWeightById(newItem,count) then
   			setPlayerStorageValue(cid,config.storage,1)
   			doPlayerAddItem(cid,newItem,count)
   			doPlayerSendTextMessage(cid,21,msgGetItem)
		else
			doPlayerSendTextMessage(cid,21,msgNoCap)
		end
   	else
   		doPlayerSendTextMessage(cid,21,msgEmpty)
   	end
   	return TRUE
end
 
Last edited:
Yes I do sorry about that. getItemWeightById getItemArticleById getItemNameById all say a nil value when I try to open the chest
 
Thanks limos that worked perfectly. Id rep you but i gotta spread some more around :<

Thats strange why i cant use certain functions. especially the doPlayerSendText oh well if it works im satisfied
 
Back
Top