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

arena.lua working but give errors :( anyone help ?

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
here is script i use , it works wery well but gave errors :|
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)
local mana = (getCreatureMaxMana(p.cid)  * 0.8)

    doCreatureAddHealth(p.cid, getCreatureMaxHealth(p.cid))
    doCreatureAddMana(p.cid, -mana)
    doRemoveCondition(p.cid, CONDITION_INFIGHT)
    doSendMagicEffect(p.exit, 10)
    doTeleportThing(p.cid, p.exit, FALSE)
end

function onPrepareDeath(cid, killer)
    if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
        addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
    end
    return TRUE
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

these are the errors:
Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaGetCreatureMaxMana(). Creature not found

Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaGetCreatureMaxHealth(). Creature not found

Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaDoCreatureAddHealth(). Creature not found

Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaDoCreatureAddMana(). Creature not found

Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaDoRemoveCondition(). Creature not found

Lua:
Lua Script Error: [CreatureScript Interface]
in a timer event called from:
data/creaturescripts/scripts/arena.lua:onPrepareDeath

luaDoTeleportThing(). Thing not found
 
I SAID IT WORKS , ON Windows i dont have any error , i put everything on Dedicated Server & ARENA IS WORKING BUT GAVE ERRORS.
 
i did caps because you doesn't understand me ...

so can you help me fix these errors or will you just talk with me like its chat.
 
Back
Top