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

WineGums

Every Day I'm Shuffelin
Joined
Jul 7, 2011
Messages
19
Reaction score
1
Hi there! Is it any script that only let u choose 1 reward item of 2 chest ?

Regards winegums
 
doublechest.lua
Code:
local config = {
	storage = 77778,
	item1 = 0, -- Item id of the item to be in the first chest.
	amount1 = 0, -- Amount of that item.
	item2 = 0, -- Item of the item to be in the second chest.
	amount2 = 0 -- Amount of that item.
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (item.uid == 63331) then
		if (getCreatureStorage(cid, config.storage) == -1) then
			doPlayerAddItem(cid, config.item1, config.amount1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have recieved the item " .. getItemNameById(config.item1) .. ".")
		else
			doPlayerSendCancel(cid, "This chest is empty.")
		end
	elseif (item.uid == 63332) then
		if (getCreatureStorage(cid, config.storage) == -1) then
			doPlayerAddItem(cid, config.item2, config.amount2)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have recieved the item " .. getItemNameById(config.item2) .. ".")
		else
			doPlayerSendCancel(cid, "This chest is empty.")
		end
	end
	return true
end

actions.xml
Code:
<action uniqueid="63331" event="script" value="doublechest.lua"/>
<action uniqueid="63332" event="script" value="doublechest.lua"/>
 
Back
Top