• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Gate opening

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello,
Ive created very interesting quest, and this script is a part of it.
Its like DHQ lever, but now you must stand on X tiles at once to remove X walls for X seconds.
Then tiles back to normal and walls appears again, everything is configurable.

Code:
local positions = {
{x=865, y=1171, z=9},
{x=871, y=1199, z=9},
{x=893, y=1169, z=9}
}
local bonesPositions = {
{x=865, y=1185, z=9},
{x=865, y=1186, z=9},
{x=865, y=1187, z=9}
}
local blockID = 6890
local openTime = 60
function onStepIn(cid, item, pos)
    doTransformItem(item.uid, 425)
    for i = 1, #positions do
        local v = getTopCreature(positions[i]).uid
        if not isPlayer(v) then
            return true
        end
    end

    if getGlobalStorageValue(8471) < os.time() then
        setGlobalStorageValue(8471,os.time()+openTime)
        addEvent(bonesBack, openTime * 1000)
        for i = 1, #bonesPositions do
            local v = getTileItemById(bonesPositions[i], blockID)
            doSendMagicEffect(bonesPositions[i], 13)
            doRemoveItem(v.uid, 1)
        end
    end
    return true
end

function bonesBack()
local bones = getTileItemById(bonesPositions[1], blockID)
    if bones.uid <= 0 then
        for i = 1, #bonesPositions do
            doCreateItem(blockID, 1, bonesPositions[i])
            doSendMagicEffect(bonesPositions[i], 13)
        end
        for i = 1, #positions do
            local v = getThingfromPos(positions[i])
            doTransformItem(v.uid,426)
            doSendMagicEffect(positions[i], 13)
        end
    end
end
 
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if getGlobalStorageValue(8471) < os.time() then
        doTransformItem(item.uid, 426)
    end
return true
end

You must add action id on every tile you chosen.
 
nice man !
i want the players to get tped when there are 3 players on 3 tiles, how can i do it?
i tried this but it tps the player directly even if there is only one player

Code:
local positions = {
        {x=31542, y=31460, z=7, stackpos = 253},
        {x=31541, y=31510, z=7, stackpos = 253},
        {x=31540, y=31510, z=7, stackpos = 253}

        }
local new_positions = {
        {x = 3152, y = 30484, z = 7},
        {x = 31951, y = 30484, z = 7},
        {x = 31951, y = 30484, z = 7}
        }
       
function onStepIn(cid, item, pos)
    for i = 1, #positions do
        local v = getThingfromPos(positions[i]).uid
        if isPlayer(v) == TRUE and v then


            doSendMagicEffect(new_positions[i], 13)
            doTeleportThing(v, new_positions[i])
       
            return true
        end
    end
end
 
Code:
local positions = {
        {x=31542, y=31460, z=7, stackpos = 253},
        {x=31541, y=31510, z=7, stackpos = 253},
        {x=31540, y=31510, z=7, stackpos = 253}

        }
local new_positions = {
        {x = 3152, y = 30484, z = 7},
        {x = 31951, y = 30484, z = 7},
        {x = 31951, y = 30484, z = 7}
        }
       
function onStepIn(cid, item, pos)
    for i = 1, #positions do
        local v = getTopCreature(positions[i]).uid
        if not isPlayer(v) then
            return true
        end
    end
   
    for i = 1, #positions do
        doSendMagicEffect(new_positions[i], 13)
        doTeleportThing(v, new_positions[i])
    end
    return true
end
 
Back
Top