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

Script To One Chest

ayla

New Member
Joined
Jul 8, 2009
Messages
71
Reaction score
0
Well as The title Says

Somebodoy Could Help Me Whit This Script....
This Mines...

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

voc = getPlayerVocation(cid)
queststatus = getPlayerStorageValue(cid,11554)


if voc == 1 then
if queststatus == -1 then
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2152,100)
doPlayerAddItem(cid,8820,1)
doPlayerAddItem(cid,8819,1)
doPlayerAddItem(cid,2647,1)
doPlayerAddItem(cid,2190,1)
doPlayerAddItem(cid,2175,1)
doPlayerAddItem(cid,2173,1)
setPlayerStorageValue(cid,11554,1)
else
doPlayerSendTextMessage(cid,22,"you already did this quest.")
end
elseif voc == 2 then
if queststatus == -1 then
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2152,100)
doPlayerAddItem(cid,8820,1)
doPlayerAddItem(cid,8819,1)
doPlayerAddItem(cid,2647,1)
doPlayerAddItem(cid,2175,1)
doPlayerAddItem(cid,2182,1)
doPlayerAddItem(cid,2173,1)
setPlayerStorageValue(cid,11554,1)
else
doPlayerSendTextMessage(cid,22,"you already did this quest")
end
elseif voc == 3 then
if queststatus == -1 then
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2152,100)
doPlayerAddItem(cid,8872,1)
doPlayerAddItem(cid,2457,1)
doPlayerAddItem(cid,2647,1)
doPlayerAddItem(cid,2525,1)
doPlayerAddItem(cid,2389,1)
doPlayerAddItem(cid,2173,1)
setPlayerStorageValue(cid,11554,1)
else
doPlayerSendTextMessage(cid,22,"you already did this quest.")
end
elseif voc == 4 then
if queststatus == -1 then
doPlayerAddItem(cid,1998,1)
doPlayerAddItem(cid,2152,100)
doPlayerAddItem(cid,2457,1)
doPlayerAddItem(cid,2463,1)
doPlayerAddItem(cid,2647,1)
doPlayerAddItem(cid,2525,1)
doPlayerAddItem(cid,2428,1)
doPlayerAddItem(cid,2417,1)
doPlayerAddItem(cid,3963,1)
doPlayerAddItem(cid,2173,1)

setPlayerStorageValue(cid,11554,1) else
doPlayerSendTextMessage(cid,22,"you already did this quest.")
end
else
return 0
end

return 1
end

And On Server...
02:11 You see a chest (Vol:15).
It weighs 120.00 oz.
ItemID: [1740], UniqueID: [3540].
Position: [X: 105] [Y: 38] [Z: 7].

This Chest Contains Those Items For Knight/paladin/druid/sorc It Depends What vocation You Chosee In Your Begging

Now My Problem Is, when I Open This chest Doesn't Give Me Those Items Just Give a Door Of Gate Exp -.-"
sooo My Idea Is If Somebody Could Help Me whit This
Thnx.
 
You must register it in actions.xml
XML:
	<action uniqueid="3540" script="script_name.lua"/>
LUA:
local t = { 
	[1] = {2175, 2190, 8819, 8820},
	[2] = {2175, 2182, 8819, 8820},
	[3] = {2525, 2389, 8872, 2457},
	[4] = {2525, 2428, 2463, 2457, 2417, 3963}
}
local shared = {2647, 2173, 2643, 1998, {2152, 100}}
local storage = 11554

for _, k in ipairs(t) do
	for _, v in ipairs(shared) do
		table.insert(k, v)
	end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, storage) == -1 then
		local v = t[getPlayerVocation(cid)]
		if v then
			for _, k in ipairs(v) do
				if type(k) == 'number' then
					doPlayerAddItem(cid, k, 1)
				else
					doPlayerAddItem(cid, k[1], k[2] or 1)
				end
			end
		end
		setPlayerStorageValue(cid, storage, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You already did this quest.')
	end
	return TRUE
end
 
Last edited:
My Actions is already Register on actions.XML
but still giving me a Door Of Exp Gate
And i want give me those Items Wich, Depends What Voc You are. :/
how can i do this?
 
Back
Top