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

mana rune error

mocoba

New Member
Joined
Aug 23, 2008
Messages
332
Reaction score
0
[07/02/2010 19:50:34] [Error - Action Interface]
[07/02/2010 19:50:34] data/actions/scripts/mana rune.lua:onUse
[07/02/2010 19:50:34] Description:
[07/02/2010 19:50:34] data/actions/scripts/mana rune.lua:14: attempt to call global 'doRemoveitem' (a nil value)
[07/02/2010 19:50:34] stack traceback:
[07/02/2010 19:50:34] data/actions/scripts/mana rune.lua:14: in function <data/actions/scripts/mana rune.lua:4>
how i fix it
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 2) + (mlevel * 1) - 50
local mana_maximum = (level * 3) + (mlevel * 1)
local mana_add = math.random(mana_minimum, mana_maximum)

doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveitem(item.uid)
return TRUE
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == TRUE then
		local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
		local mana_minimum = level * 2 + mlevel * 1 - 50
		local mana_maximum = level * 3 + mlevel * 1

		doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
	end
	return TRUE
end
 
Back
Top