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

Why does this script not work?

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
743
Solutions
5
Reaction score
200
Location
Pr0land
GitHub
Erexo
Hello,
i have a script:

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
doCreatureAddMana(cid, getCreatureMaxMana(cid) / 5)
doCreatureAddHealth(cid, getCreatureMaxMana(cid) / 5)
doSendMagicEffect(ppos, 40)
doRemoveItem(item.uid,1)
return true
end

Im wanna then add a 20% hp/ 20% mp/remove/send magic effect and set a healing spells exhaused...

Its add a hp/mana, remove item, send magic effect but, not add a exhaused -.-

Someone can help me? Please.

Erexo.
 
you didnt put a line to add exaust...
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
doCreatureAddMana(cid, getCreatureMaxMana(cid) / 5)
doCreatureAddHealth(cid, getCreatureMaxMana(cid) / 5)
doSendMagicEffect(ppos, 40)
doAddCondition(cid, exhaust)
doRemoveItem(item.uid,1)
return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local ppos = getPlayerPosition(cid)
local mana = getPlayerMaxMana(cid)
local addAmount = (mana/5)
	if ppos == ppos then
		doCreatureAddMana(cid,addAmount)
		doCreatureAddHealth(cid,addAmount)
		doSendMagicEffect(ppos,40)
		doRemoveItem(item.uid,1)
        end
return true
end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local ppos = getPlayerPosition(cid)
local mana = getPlayerMaxMana(cid)
local addAmount = (mana/5)
	if ppos == ppos then
		doCreatureAddMana(cid,addAmount)
		doCreatureAddHealth(cid,addAmount)
		doSendMagicEffect(ppos,40)
		doRemoveItem(item.uid,1)
        end
return true
end

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ppos = getPlayerPosition(cid)
		doPlayerAddMana(cid,getPlayerMaxMana(cid) / 5)
		doCreatureAddHealth(cid,getCreatureMaxHealth(cid) / 5)
		doSendMagicEffect(ppos,40)
		doRemoveItem(item.uid,1)
        return true
end
 
LUA:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end
	
	doAddCondition(cid, exhaust)
	doRemoveItem(item.uid,1)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
	doSendMagicEffect(fromPosition, CONST_ME_BIGCLOUDS)
	return true
end
 
CyberM,

you script wont work, maybe becouse this:

Code:
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	end

When i use it (on gm too), say "You are exhausted"...
 
ok no gm then..
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if exhaustion.check(cid, 1345) then
		return doPlayerSendCancel(cid, 'You can not use this yet['..exhaustion.get(cid, 1345)..'].')
	else
		exhaustion.set(cid, 1345, 60)
	end
	
	doRemoveItem(item.uid,1)
	doSendMagicEffect(fromPosition, CONST_ME_BIGCLOUDS)
	doCreatureAddMana(cid, math.floor(getCreatureMaxMana(cid)*0.20))
	doCreatureAddHealth(cid, math.floor(getCreatureMaxHealth(cid)*0.20))
	return true
end
 
Last edited:
@up
you dont understand me...

When i use it on gm, then say "you are exhausted"...
On players too (always, never use a item)...
 
Back
Top