CesarZ
Well-Known Member
- Joined
- Sep 20, 2012
- Messages
- 268
- Solutions
- 4
- Reaction score
- 63
I been trying to figure out whats going on with this lua. it wont let me login.
Lua:
local arena = {
frompos = {x = 784, y = 1039, z = 7},
topos = {x = 798, y = 1055, z = 7},
exitpos = {x = 790, y = 1036, z = 7}
}
function onPrepareDeath(player, lastHitKiller, mostDamageKiller)
if player:isPlayer() then
local ppos = player:getPosition()
if isInRange(ppos, arena.frompos, arena.topos) then
local maxhp = player:getMaxHealth()
player:addHealth(maxhp)
addEvent(doCreatureAddHealth, 100, player:getId(), maxhp)
player:sendTextMessage(MESSAGE_STATUS_WARNING,"[Arena]: You lost the duel.")
end
if isInRange(ppos, arena.frompos, arena.topos) then
player:teleportTo(arena.exitpos)
return true
end
end
return true
end
function onLogin(player)
player:registerEvent("pvparena")
return true
end