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

HOw to get exhausted..

ibkfly

New Member
Joined
Jan 1, 2010
Messages
69
Reaction score
4
Hey i made a spell.
When i press the hotkey for the spell, i can just hold it down it the spell will be used like 120291029 times. How am I supposed to get exhaustion? And another thing. I made it so you need 900 mana for the spell. If i have 899 mana it doesnt work, but if i have 900+ i dont lose mana at all! what the fuck is weird about this i had this spell in a prevous 8.42 server, and it worked fine.:::::
 
special spell, forgot about return TRUE, easy :D
your onCastSpell function should look like this
Code:
function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var} 
addEvent(onCastSpell1, 1, parameters) 
addEvent(onCastSpell2, 70, parameters) 
addEvent(onCastSpell3, 140, parameters) 
addEvent(onCastSpell4, 210, parameters)
addEvent(onCastSpell5, 280, parameters)
addEvent(onCastSpell6, 350, parameters)
addEvent(onCastSpell7, 420, parameters)
return TRUE
end
just add return TRUE before last end and it will be fine
 
maybe try using exhaustion.set and exhaustion.check ;D?

Try this
Code:
function onCastSpell(cid, var) 
local parameters = { cid = cid, var = var}
local exhaust = 1000 -- 1 second
	if(exhaustion.check(cid, 99987) < 1) then
		addEvent(onCastSpell1, 1, parameters) 
		addEvent(onCastSpell2, 70, parameters) 
		addEvent(onCastSpell3, 140, parameters) 
		addEvent(onCastSpell4, 210, parameters)
		addEvent(onCastSpell5, 280, parameters)
		addEvent(onCastSpell6, 350, parameters)
		addEvent(onCastSpell7, 420, parameters)
		exhaustion.set(cid, 99987, exhaust)
	else
		doPlayerSendCancel(cid, "You are exhausted. Seconds: "..exhaustion.get(cid, 99987)..".")
		end
	return true
end
 
Last edited:
Back
Top Bottom