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
What is wrong?
I know it enters here
because it tells me that 3513 almost died. Altho it is not adding the health for some reason or mana.(isPlayer(attacker) == true)
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