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

Solved Send Players to Temple on prepareDeath

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,901
Reaction score
26
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.
 
Try forcing the health to be added: doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
 
Back
Top