• 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!

RevScripts No walk through

This?
Lua:
local moveEvent = MoveEvent('blockWalk')

function moveEvent.onStepIn(player, item, position, fromPosition)
    player:teleportTo(fromPosition)
    return true
end

-- moveEvent:id(ITEM_ID)
-- moveEvent:aid(ACTION_ID)
moveEvent:register()
 
Maybe you mean this in config.lua?
allowWalkthrough = true
No but realy thank for ur aswer (love ur scripts) just some randomdtitles, not all.
This?
Lua:
local moveEvent = MoveEvent('blockWalk')

function moveEvent.onStepIn(player, item, position, fromPosition)
    player:teleportTo(fromPosition)
    return true
end

-- moveEvent:id(ITEM_ID)
-- moveEvent:aid(ACTION_ID)
moveEvent:register()
YES! exacly, so when i want to make the title no walk-thourhg, i habe to put there
-- moveEvent:aid(ACTION_ID)
my imaginary ID and them in RME in title?
 
If you don't want to handle actionIds, you can use a table of positions and define blocked tiles
Lua:
local blockedPositions = {
    Position(3189, 1814, 7),
    Position(3191, 1809, 7)
}

local event = MoveEvent()

function event.onStepIn(creature, item, pos, fromPosition)
    if creature:isPlayer() then
        creature:teleportTo(fromPosition, false)
    end
    return true
end

event:position(unpack(blockedPositions))
event:register()
 
Last edited:
If you don't want to handle actionIds, you can use a table of positions and define blocked tiles
Lua:
local blockedPositions = {
    Position(3189, 1814, 7),
    Position(3191, 1809, 7)
}

local event = MoveEvent()

function event.onStepIn(creature, item, pos, fromPosition)
    creature:teleportTo(fromPosition, false)
    return true
end

event:position(unpack(blockedPositions))
event:register()

Ant cant evem walk on the title :D i want to walk on it but players cant walk trought themself, like old tibia system
 
Last edited:
isn't that what you wanted to achieve? ..to push back players who try walking over a tile?
ohh, i think i had said to wrong :p, i mean player cant walk through plaayer. There is a 'queue' in my event, so player have to stay in 'line' something like1title-1player. And this is for onlny 10 sqaures (titles) not the all MAP! :)



Like some1 up said 'allowWalkthrough = true' but no all game, just some titles.
 
ohh, i think i had said to wrong :p, i mean player cant walk through plaayer. There is a 'queue' in my event, so player have to stay in 'line' something like1title-1player. And this is for onlny 10 sqaures (titles) not the all MAP! :)



Like some1 up said 'allowWalkthrough = true' but no all game, just some titles.
have you tried depot tiles? 11062/11063
 
try this
Lua:
local blockedPositions = {
    Position(3189, 1814, 7),
    Position(3191, 1809, 7)
}

local event = MoveEvent()

function event.onStepIn(creature, item, pos, fromPosition)

    if not creature:isPlayer() then
        return true
    end
 
    local tile = Tile(pos)
    if tile then
        if #tile:getCreatures() > 1 then
            creature:teleportTo(fromPosition, false)
            return true
        end
    and
    return true
end

event:position(unpack(blockedPositions))
event:register()
 
Modified @Sarah Wesker 's version to register multiple positions using from & to position.

Skärmavbild 2021-04-13 kl. 15.52.51.png

Lua:
local config = {
    from = Position(3189, 1814, 7),
    to   = Position(3191, 1809, 7)
}

local function preparePositions(callback)
    local blockedPositions = {}
    local z = config.from.z
    for x = config.from.x, config.to.x do
        for y = config.from.y, config.to.y do
            table.insert(blockedPositions, Position(x, y, z))
        end
    end
    callback(blockedPositions)
end

preparePositions(function(args)
    local event = MoveEvent('test')
    function event.onStepIn(creature, item, pos, fromPosition)
        if not creature:isPlayer() then
            return true
        end

        local tile = Tile(pos)
        if tile then
            if #tile:getCreatures() > 1 then
                creature:teleportTo(fromPosition, false)
                return true
            end
        end

        return true
    end

    event:position(unpack(args))
    event:register()
end)
 
Back
Top