• 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] Help to fix this function

Jetro

jangeldev
Joined
Aug 1, 2011
Messages
452
Reaction score
68
Location
Venezuela
Hi guys, i need help, i have created this function:

LUA:
function setCreatureHealth(cid, health)
	a = getCreatureMaxHealth(cid)
	b = a - health
	
		if a - b > 0 then
			return doCreatureAddHealth(cid, -b)
		else
			return 0
		end
	
	return 1
end


actually it has a bug, when i use this function in a summon, the server get crash, can someone help me to solve this?
Thanks in advance :)
 
LUA:
function setCreatureHealth(cid, health)
	return (getCreatureMaxHealth(cid) - health) > 0 and doCreatureAddHealth(cid, -(getCreatureMaxHealth(cid) - health)) or true
end
 
Back
Top