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

Lua A quest mission script

sick

Member
Joined
Feb 5, 2009
Messages
258
Reaction score
6
Location
Lithuania, Vilnius
I'm creating a new quest and I'm stuck at one script:
When i use pick on these stones i get 1 small stone, but that works just once, if you try to get a second small stone it says something like - You have already done this.

44478301.png


If anyone could make this script I would be very glad :) The id of pick: 2553 and stones: 9421.
Thanks in advance
 
Lua:
local storage = 8192

function onUse(cid, item,  fromPosition, itemEx, toPosition)
	if itemEx.itemid == 9421 then
		if getPlayerStorageValue(cid, storage) == -1 then
			doPlayerAddItem(cid, 1294, 1)
			doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
			setPlayerStorageValue(cid, storage, 1)
		else
			doPlayerSendCancel(cid, 'You have already done this.')
		end
		return true
	end
end
combined with normal pick.lua:
Lua:
local storage = 8192

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
		doTransformItem(itemEx.uid, 392)
		doDecayItem(itemEx.uid)
		doSendMagicEffect(toPosition, CONST_ME_POFF)
		return true
	end

	if(itemEx.itemid == 7200) then
		doTransformItem(itemEx.uid, 7236)
		doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
		return true
	end

	if(itemEx.itemid == 9421) then
		if(getPlayerStorageValue(cid, storage) == -1) then
			doPlayerAddItem(cid, 1294, 1)
			doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
			setPlayerStorageValue(cid, storage, 1)
		else
			doPlayerSendCancel(cid, 'You have already done this.')
		end
		return true
	end

	return false
end
 
Back
Top