This is a script made by Ezzam, it works almost. The only things that doesn't work are the messages and that the winner doesn't get teleported to arena.exit.
I use tfs 0.3.5 pl1, plz fix it someone
Or give me some working pvp arena script
Creaturescripts\scripts\pvparena.lua
I use tfs 0.3.5 pl1, plz fix it someone
Or give me some working pvp arena script
Creaturescripts\scripts\pvparena.lua
Code:
local arena = {
frompos = {x=xxx, y=xxx, z=x},
topos = {x=xxx, y=xxx, z=x},
exit = {x=xxx, y=xxx, z=x}
}
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == TRUE then
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE) == TRUE then
if doTeleportThing(cid, arena.exit) == TRUE then
doSendMagicEffect(arena.exit, 10)
doPlayerSendTextMessage(mostDamageKiller,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You have defeated '..getPlayerName(cid)..'!')
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,'[ARENA] You where defeated by '..getPlayerName(mostDamageKiller)..'!')
return FALSE
end
end
end
end
return TRUE
end