• 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 Spell not working!

sebas182

New Member
Joined
Aug 10, 2008
Messages
121
Reaction score
1
I want to get the exhaust amount of one storage, if it are true (> 0) then the "local test" becomes = 1, else, becomes = 100. but the exhaust is get from the target, not cid.

if I use:
Lua:
function onGetFormulaValues(cid, level, skill, attack, factor)
	if exhaustion.check(variantToNumber(var), 26000) == true then
		local test = 1
		exhaustion.set(variantToNumber(var), 26000, 0)
	else
		local test = 100
	end
		return -test*2, -test*2
end
you have the error:
In a callback: spell.lua:eek:nGetFormulaValues(Unknown script file)
Description:
attempt to index a nil value

I think it's becose exhaust is not about formula, or it just not take the target yet, I dont know whats wrong!
 
PHP:
function onGetFormulaValues(cid, level, skill, attack, factor)
	if exhaustion.check(cid, 26000) == true then
		local test = 1
		exhaustion.set(cid, 26000, 0)
	else
		local test = 100
	end
		return -test*2, -test*2
end
 
Back
Top