• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

RevScripts check fromPosition - toPosition

alcapone

Member
Joined
Jan 13, 2021
Messages
158
Reaction score
12
Lua:
      positionsArena = {
            fromPosition = Position(1549, 994, 7),
            toPosition = Position(1579, 1020, 7)
        },   


local CastlePrepareDeath = CreatureEvent('CastlePrepareDeath')
function CastlePrepareDeath.onPrepareDeath(player, killer)
 
 
    player:teleportTo(Position(1525, 1032, 7))
    player:setHealth(player:getMaxHealth())
    player:addMana(player:getMaxMana())
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'[Event Castle] ' .. player:getName() .. ' was killed.')
 
    return true
end   
CastlePrepareDeath:register()


how could i check this arena to activate only if the player is in it
 
Solution
Lua:
local positionsArena = {
    fromPosition = Position(1549, 994, 7),
    toPosition = Position(1579, 1020, 7)
}

local CastlePrepareDeath = CreatureEvent('CastlePrepareDeath')
function CastlePrepareDeath.onPrepareDeath(player, killer)
     if player:getPosition():isInRange(positionsArena.fromPosition, positionsArena.toPosition) then
        player:teleportTo(Position(1525, 1032, 7))
        player:setHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'[Event Castle] ' .. player:getName() .. ' was killed.')
    end
    return true
end   
CastlePrepareDeath:register()

Roddet

life.rbegin()
Joined
May 1, 2013
Messages
643
Solutions
61
Reaction score
380
Location
MX
Lua:
local positionsArena = {
    fromPosition = Position(1549, 994, 7),
    toPosition = Position(1579, 1020, 7)
}

local CastlePrepareDeath = CreatureEvent('CastlePrepareDeath')
function CastlePrepareDeath.onPrepareDeath(player, killer)
     if player:getPosition():isInRange(positionsArena.fromPosition, positionsArena.toPosition) then
        player:teleportTo(Position(1525, 1032, 7))
        player:setHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'[Event Castle] ' .. player:getName() .. ' was killed.')
    end
    return true
end   
CastlePrepareDeath:register()
 
Solution
OP
OP
A

alcapone

Member
Joined
Jan 13, 2021
Messages
158
Reaction score
12
Lua:
local positionsArena = {
    fromPosition = Position(1549, 994, 7),
    toPosition = Position(1579, 1020, 7)
}

local CastlePrepareDeath = CreatureEvent('CastlePrepareDeath')
function CastlePrepareDeath.onPrepareDeath(player, killer)
     if player:getPosition():isInRange(positionsArena.fromPosition, positionsArena.toPosition) then
        player:teleportTo(Position(1525, 1032, 7))
        player:setHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'[Event Castle] ' .. player:getName() .. ' was killed.')
    end
    return true
end  
CastlePrepareDeath:register()
a doubt is there any way to check floors?
 
Top