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

Adding Health to player (problem)

Magictibiaman

New Member
Joined
May 25, 2009
Messages
371
Reaction score
0
When i try this it doesn't at health to my player
I know it enters here
(isPlayer(attacker) == true)
because it tells me that 3513 almost died. Altho it is not adding the health for some reason or mana.
What is wrong?

Code:
function onStatsChange(cid, attacker, type, combat, value)
local destinations = {
		{x = 32461, y = 31500, z = 7} ,
		{x = 32461, y = 31495, z = 7} 
}
	if getPlayerStorageValue(cid, 3513) == 1 and getPlayerStorageValue(attacker, 3514) == 1 then
		if getCreatureHealth(cid) <= value then
			if (isPlayer(attacker) == true) then
				doTeleportThing(cid, destinations[1])			
				doCreatureAddHealth(cid, 10000)
				doCreatureAddMana(cid, getCreatureMaxMana(cid))
				doBroadcastMessage("3513 almost died")

				if getGlobalStorageValue(6543) == 1 then
					setGlobalStorageValue(6543, -1)
					doBroadcastMessage("" .. getCreatureName(cid) .. " has dropped the flag.", MESSAGE_LAST)
				elseif getGlobalSTorageValue(6544) == 1 then
					setGlobalStorageValue(6544, -1)
					doBroadcastMessage("" .. getCreatureName(cid) .. " caused flag Error. FIXED ", MESSAGE_LAST)

				end		
			end
		end
 
I didn't understand you.. But, if the problem is that the player doesn't get his health filled. Try this:

Code:
function onStatsChange(cid, attacker, type, combat, value)
local destinations = {
		{x = 32461, y = 31500, z = 7} ,
		{x = 32461, y = 31495, z = 7} 
}
	if getPlayerStorageValue(cid, 3513) == 1 and getPlayerStorageValue(attacker, 3514) == 1 then
		if getCreatureHealth(cid) <= value then
			if (isPlayer(getCreatureByName(getPlayerNameByGUID(attacker))) == true) then
				doTeleportThing(cid, destinations[1])			
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 1)
				doCreatureAddMana(cid, getCreatureMaxMana(cid))
				doBroadcastMessage("3513 almost died")

				if getGlobalStorageValue(6543) == 1 then
					setGlobalStorageValue(6543, -1)
					doBroadcastMessage("" .. getCreatureName(cid) .. " has dropped the flag.", MESSAGE_LAST)
				elseif getGlobalSTorageValue(6544) == 1 then
					setGlobalStorageValue(6544, -1)
					doBroadcastMessage("" .. getCreatureName(cid) .. " caused flag Error. FIXED ", MESSAGE_LAST)

				end		
			end
 
Sorry.. Just corrected the script. Please, check it once again.

So?
Did it work, with the GUID and name change??
 
Last edited:
Back
Top