Sir Islam
Never Give Up
don't register in login and don't forget to remove Pvp tool from arena in map editor
in creaturescripts.xml put this code
make file name Arena_Death.lua and put this code
in creaturescripts.xml put this code
Code:
<event type="login" name="Arena_Login" script="Arena_Death.lua"/>
<event type="preparedeath" name="Arena_Death" script="Arena_Death.lua"/>
Code:
function onLogin(cid)
cid:registerEvent("Arena_Death")
return true
end
local arena = {
from = {x=1590, y=1809, z=7}, -- left top corner of arena
to = {x=1669, y=1867, z=7}, -- right bottom corner of arena
temple = { x = 2000, y = 2000, z = 7 } -- change it to temple pos
}
function onPrepareDeath(cid, killer)
if isInRange(getPlayerPosition(cid), arena.from,arena.to) then
if isPlayer(cid) then
Player(cid):addHealth(Player(cid):getMaxHealth())
Player(cid):addMana(Player(cid):getMaxMana())
Player(cid):teleportTo(arena.temple, true)
return false
end
end
return true
end
function isInRange(pos, fromPos, toPos)
return pos.x >= fromPos.x and pos.y >= fromPos.y and pos.z >= fromPos.z and pos.x <= toPos.x and pos.y <= toPos.y and pos.z <= toPos.z
end
Last edited: