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

lever with time

Joined
Mar 7, 2017
Messages
46
Solutions
1
Reaction score
6
I have this script, it works fine and everything just that I would like it to have a time limit for it to return and remove the stones
Can somebody help me-

Lua:
local levervip2 = Action()

function levervip2.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local teleportPosition = {x = 32113, y = 33064, z = 14}
    local stonePosition = {x = 32128, y = 33061, z = 14}

    if item.itemid == 2772 then
        local teleport = Game.createItem(1949, 1, teleportPosition)
        if teleport then
            teleport:setDestination({x = 32097, y = 33062, z = 15})
            Position(teleportPosition):sendMagicEffect(CONST_ME_TELEPORT)
        end

        Tile(stonePosition):getItemById(1791):remove()
        item:transform(2773)
    elseif item.itemid == 2773 then
        Position(stonePosition):hasCreature({x = 32128, y = 33063, z = 14})
        Tile(teleportPosition):getItemById(1949):remove()
        Position(teleportPosition):sendMagicEffect(CONST_ME_POFF)
        Game.createItem(1791, 1, stonePosition)
        item:transform(2772)
    end
    return true
end

levervip2:uid(39868)
levervip2:register()
 
Back
Top