• 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]Can't Figure out Arena :| Need little help

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
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

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:
an0wvt.png


2eyc5qv.png
 
Last edited:
in function "exitArena" change
Lua:
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
to
Lua:
    doCreatureAddHealth(p.cid, getCreatureMaxHealth(p.cid))
 
thanksss :*** everything work :p

btw. i need to change
Lua:
  if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
to
Lua:
  if doCreatureAddHealth(p.cid, getCreatureMaxHealth(p.cid) - getCreatureHealth(p.cid), TRUE) == TRUE then

+rep xP

oh & can you tell me what i should do , cuz if player attacked & got killed , it got tped to exit & healed but it has still PZ Locked :( how to rm PZ or something?
 
Back
Top