I'm using the pvp arena script included in the forgotten 0.2.4 and I keep getting this error message?
ffa-pvparena.lua:20: attempt to call global 'isInPosition' (a nil value)
Can anyone help? Thanks!
ffa-pvparena.lua:20: attempt to call global 'isInPosition' (a nil value)
Can anyone help? Thanks!
Code:
local pvpArena =
{
-- PVP Arena #1:
{
fromPosition = {x = 693, y = 693, z = 11},
toPosition = {x = 713, y = 713, z = 11},
positionToTeleportToOnDeath = {x = 704, y = 694, z = 11}
},
-- PVP Arena #2:
{
fromPosition = {x = 20000, y = 20000, z = 4},
toPosition = {x = 20020, y = 20023, z = 10},
positionToTeleportToOnDeath = {x = 20025, y = 20025, z = 7}
}
}
function onPrepareDeath(cid, killer)
for i, v in ipairs(pvpArena) do
if isInPosition(getCreaturePosition(cid), v.fromPosition, v.toPosition) then
while getCreatureHealth(cid) < getCreatureMaxHealth(cid) do
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
end
doTeleportThing(cid, v.positionToTeleportToOnDeath, TRUE)
break
end
end
end