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

Advenced Chest

Dejm

Oh hun...
Joined
Nov 29, 2008
Messages
120
Reaction score
4
Location
United Kingdom
Hello,


I have a question. How to make chest with items inside that for example (Only Knight) can open it)?


 
data/actions/scripts/adv_chest.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local chest = {
		vocs = { 4, 8, 12 },
		level = 100,
		storage = 23315,
		items = { 
			{2160,1},
			{2152,1}
		}
	}
	if(getPlayerStorageValue(cid, chest.storage) == -1) then
		if(isInArray(chest.vocs, getPlayerVocation(cid)) == true) then
			if(getPlayerLevel(cid) >= chest.level) then
				for i = 1, #chest.items do
					local v = chest.items[i]
					local rewards = doCreateItemEx(v[1], v[2])
					if(doPlayerAddItemEx(cid, rewards, true) ~= RETURNVALUE_NOERROR) then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You do not have enough capacity to carry your reward.")
					else
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Here is your reward.")
						doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
						setPlayerStorageValue(cid, chest.storage, 1)
					end
				end
			else
				doPlayerSendCancel(cid, "Your level is not high enough.")
			end
		else
			doPlayerSendCancel(cid, "Only knights may open this chest.")
		end
	else
		doPlayerSendCancel(cid, "The " .. getItemName(item.uid) .. " is empty.")
	end
	return true
end
 
It's working now :) It was my mistake..


But If I am here, I have diffrent problem. So I have Acc Maker (Gesior) and how do I change Temple Position?
I tried by changing it in database(Sample Sorcerer etc.), but it won't work :(
 
Not sure what the first error is.

For the second error, edit houseXML_file_subdir in your /config/config.ini

Also, tickers are not working in Gesior AAC 0.3.1
 
Back
Top