i am using this script , i tried to change something & add but still all time character after being killed by someone on Arena , has 0 HP and is outside , take a look at Screen Shots on the bottom of topic.
oh btw there appear some errors , maybe by fixing them should help? , ss on the bottom
---edit---
forgot to add , i am using TFS v0.3.1
Screen Shots:
oh btw there appear some errors , maybe by fixing them should help? , ss on the bottom
---edit---
forgot to add , i am using TFS v0.3.1
Lua:
local arena = {
frompos = { x = 168, y = 657, z = 7 },
topos = { x = 177, y = 666, z = 7 },
exit = { x = 169, y = 668, z = 6 }
}
local function exitArena(p)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doSendMagicEffect(p.exit, 10)
doTeleportThing(p.cid, p.exit, FALSE)
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doTeleportThing(p.cid, p.exit, FALSE)
end
end
function onPrepareDeath(cid, killer)
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
end
return FALSE
end
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end
Screen Shots:
Last edited: