Eduardo170
Well-Known Member
I took this script from another forum and trying to create a revscript but didnt work, dont happens nothing, no print error in console.
I also want to add a lever to teleport 2 teams, each team of 4 or 5 people.
I also want to add a lever to teleport 2 teams, each team of 4 or 5 people.
Code:
local exit = Position(1011, 949, 7)
local storage = 9015
-- Code to be executed when a player with storage have died
local event = CreatureEvent("Pvparena")
function event.onPrepareDeath(player, killer)
if player:getStorageValue(storage) > 0 and killer:getStorageValue(storage) > 0 then
player:removeCondition(CONDITION_INFIGHT)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You are dead in PVP Arena!")
player:addHealth(player:getMaxHealth())
player:addMana(player:getMaxMana())
player:setStorageValue(storage, 0)
player:unregisterEvent("a")
player:teleportTo(exit)
killer:getPosition():sendMagicEffect(CONST_ME_GROUNDSHAKER)
return true
end
end
event:register()
-- Register above Pvparena creature events to players when they login
local login = CreatureEvent("Pvparena")
function login.onLogin(player)
if player:getStorageValue(storage) > 0 then
player:setStorageValue(storage, 0)
end
return true
end
login:register()
local logout = CreatureEvent("Pvparena")
function logout.onLogout(player)
if player:getStorageValue(storage) > 0 then
player:sendCancelMessage("You can not logout now!")
return false
end
return true
end
logout:register()
Last edited: