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

Quest backpack with items inside

SE000

New Member
Joined
Nov 19, 2010
Messages
43
Reaction score
1
This script is from JDB on a thread i found, but the script doesnt work. Dont know why since i dont get any errors while using the quest.

I use 0.3.6

Lua:
local config = {
	[1001] = { -- ITEM ACTIONID
		level = 100,
		storage = 45551,
		container = 1987,
		items = {
			{ 2160, 1 }, { 2152, 1 }
		}
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = config[item.actionid]
	if v then
		if getPlayerLevel(cid) >= v.level then
			if getPlayerStorageValue(cid, v.storage) < 0 then
				local item = doCreateItemEx(cid, v.container, 1)
				if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then
					return doPlayerSendCancel(cid, "Sorry, you are unable to carry this.")
				end
			
				for i = 1, #v.items do
					doAddContainerItem(item, v.items[i][1], v.items[i][2] or 1)
				end
			
				doPlayerSendTextMessage(cid, "You have found a " .. getItemInfo(v.container).name .. ".")
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				setPlayerStorageValue(cid, v.storage, 1)
			else
				return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
			end
		else
			return doPlayerSendCancel(cid, "Sorry, your level is too low.")
		end
	end
	
	return true
end
 
Put actionID 2000 and some random number as uniqueID. Then just add (in editor) a backpack in the chest, and then item(s) in the backpack.
 
theforgottenserver 0.3.6


action id: 2000

unique id not used by anything else: 3014

items in = yes

gms can take = no

when open = i see items inside the box

when moving the box = cant move it
 
Back
Top