Solved Send Players to Temple on prepareDeath

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,875
Reaction score
18
Location
Canada
I've been struggling with this script for the last day trying every different way from using Db querys and doCreatureAddHealth function but nothing works. Im using TFS 0.3.6 V5 Edited by OtSWE

(The script is just basic untill i get the AddHealth Function to work)

Code:
local towns = {
  thais = {x=32369, y=32241, z=7},
  venore = {x=32192, y=32256, z=15},
  carlin = {x=32097, y=32219, z=7}
}
function onPrepareDeath(cid, deathlist)
health = getCreatureMaxHealth(cid)
  if isPlayer(cid) == TRUE then
    if getPlayerLevel(cid) < 80 then
        if doTeleportThing(cid, towns.thais) == TRUE then
          doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
          doSendMagicEffect(towns.thais, 10)
          return FALSE
        end
    end
  end
  return TRUE
end
No matter what i do, The script teleports the player to the temple with the animation on the correct position but does NOT add health. The player stays at 0 health bugged. Im thinking maybe its a bug with the distro im using?

Any help is appreciated.
 

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,835
Reaction score
185
Try forcing the health to be added: doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
 
Top