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

Lua Addevent time to execute onStepIn after a minute

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
Lua:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and Game.isItemThere({x = 38479, y = 33920, z = 07},3696) and Game.isItemThere ({x = 38478, y = 33920, z = 07},3696) then
        Game.transformItemOnMap({x = 38478, y = 33902, z = 07}, 1791, 1947)
        Game.sendMagicEffect({x = 38478, y = 33902, z = 07}, 3)
    end
end

How can i use function Addevent time to execute this part of script here, after 1 minute ?
Game.transformItemOnMap({x = 38478, y = 31902, z = 07}, 1791, 1947)
 
Solution
Lua:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and Game.isItemThere({x = 38479, y = 33920, z = 07},3696) and Game.isItemThere ({x = 38478, y = 33920, z = 07},3696) then
        Game.transformItemOnMap({x = 38478, y = 33902, z = 07}, 1791, 1947)
        Game.sendMagicEffect({x = 38478, y = 33902, z = 07}, 3)
    end
end

How can i use function Addevent time to execute this part of script here, after 1 minute ?
Game.transformItemOnMap({x = 38478, y = 31902, z = 07}, 1791, 1947)
Try this out:
Lua:
local transformPosition = {x = 38478, y = 33902, z = 7}
local checkPosition = {
    {x = 38479, y = 33920, z = 7},
    {x = 38478, y = 33920, z = 7}
}

function onStepIn(creature, item, position...
Lua:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and Game.isItemThere({x = 38479, y = 33920, z = 07},3696) and Game.isItemThere ({x = 38478, y = 33920, z = 07},3696) then
        Game.transformItemOnMap({x = 38478, y = 33902, z = 07}, 1791, 1947)
        Game.sendMagicEffect({x = 38478, y = 33902, z = 07}, 3)
    end
end

How can i use function Addevent time to execute this part of script here, after 1 minute ?
Game.transformItemOnMap({x = 38478, y = 31902, z = 07}, 1791, 1947)
Try this out:
Lua:
local transformPosition = {x = 38478, y = 33902, z = 7}
local checkPosition = {
    {x = 38479, y = 33920, z = 7},
    {x = 38478, y = 33920, z = 7}
}

function onStepIn(creature, item, position, fromPosition)
    if not creature:isPlayer() then
        return true
    end

    if Game.isItemThere(checkPosition[1], 3696) and Game.isItemThere(checkPosition[2], 3696) then
        addEvent(function()
            if Game.transformItemOnMap(transformPosition, 1791, 1947) then
                Game.sendMagicEffect(transformPosition, 3)
            end
        end, 1 * 60 * 1000)
    end
    return true
end
 
Solution
Back
Top