• 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 Change Position Script

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Hello, I need help with this scripts, I want to change the position of the lever, it is horizontal and I want it vertical
I want you to be able to use the lever just like in the photo
V

VERTICAL.png

Lua:
local setting = {
    centerRoom = {x = 32207, y = 32047, z = 14},
    storage = Storage.DreamCourts.DreamScar.plaguerootTimer,
    Pillar1pos = {x = 32204, y = 32045, z = 14},
    bossPosition = {x = 32208, y = 32047, z = 14},
    kickPosition = {x = 32208, y = 32035, z = 13},
    playerTeleport = {x = 32207, y = 32052, z = 14}
}

local plaguerootLever = Action()

-- Start Script
function plaguerootLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 10030 and item.actionid == 30503 then
    local clearplaguerootRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)       
    for index, spectatorcheckface in ipairs(clearplaguerootRoom) do
        if spectatorcheckface:isPlayer() then
            creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
            return false
        end
    end   
    for index, removeplagueroot in ipairs(clearplaguerootRoom) do
        if (removeplagueroot:isMonster()) then
            removeplagueroot:remove()
        end
    end
        Game.createMonster("Plagueroot", setting.bossPosition, false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
    local players = {}
    for i = 0, 4 do
        local player1 = Tile({x = (Position(item:getPosition()).x + 1) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
        players[#players+1] = player1
    end
        for i, player in ipairs(players) do
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            player:teleportTo(Position(setting.playerTeleport), false)
            doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
            setPlayerStorageValue(player,setting.storage, os.time() + 20 * 60 * 60)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 15 minute(s) to defeat the boss.')
                addEvent(function()
                    local spectatorsplagueroot = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
                        for u = 1, #spectatorsplagueroot, 1 do
                            if spectatorsplagueroot[u]:isPlayer() and (spectatorsplagueroot[u]:getName() == player:getName()) then
                                player:teleportTo(Position(setting.kickPosition))
                                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
                            end
                        end
                end, 15 * 60 * 1000)
        end
    end
    return true
end

plaguerootLever:aid(30503)
plaguerootLever:register()
 
Solution
Lua:
local setting = {
    centerRoom = {x = 32207, y = 32047, z = 14},
    storage = Storage.DreamCourts.DreamScar.plaguerootTimer,
    Pillar1pos = {x = 32204, y = 32045, z = 14},
    bossPosition = {x = 32208, y = 32047, z = 14},
    kickPosition = {x = 32208, y = 32035, z = 13},
    playerTeleport = {x = 32207, y = 32052, z = 14}
}

local plaguerootLever = Action()

-- Start Script
function plaguerootLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 10030 and item.actionid == 30503 then
    local clearplaguerootRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)      
    for index, spectatorcheckface in ipairs(clearplaguerootRoom) do
        if...
Lua:
local setting = {
    centerRoom = {x = 32207, y = 32047, z = 14},
    storage = Storage.DreamCourts.DreamScar.plaguerootTimer,
    Pillar1pos = {x = 32204, y = 32045, z = 14},
    bossPosition = {x = 32208, y = 32047, z = 14},
    kickPosition = {x = 32208, y = 32035, z = 13},
    playerTeleport = {x = 32207, y = 32052, z = 14}
}

local plaguerootLever = Action()

-- Start Script
function plaguerootLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 10030 and item.actionid == 30503 then
    local clearplaguerootRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)      
    for index, spectatorcheckface in ipairs(clearplaguerootRoom) do
        if spectatorcheckface:isPlayer() then
            creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
            return false
        end
    end  
    for index, removeplagueroot in ipairs(clearplaguerootRoom) do
        if (removeplagueroot:isMonster()) then
            removeplagueroot:remove()
        end
    end
        Game.createMonster("Plagueroot", setting.bossPosition, false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
    local players = {}
    for i = 0, 4 do
         local player1 = Tile({x = (Position(item:getPosition()).x + 0) + 0, y = Position(item:getPosition()).y + 1 + i, z = Position(item:getPosition()).z}):getTopCreature()
        players[#players+1] = player1
    end
        for i, player in ipairs(players) do
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            player:teleportTo(Position(setting.playerTeleport), false)
            doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
            setPlayerStorageValue(player,setting.storage, os.time() + 20 * 60 * 60)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 15 minute(s) to defeat the boss.')
                addEvent(function()
                    local spectatorsplagueroot = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
                        for u = 1, #spectatorsplagueroot, 1 do
                            if spectatorsplagueroot[u]:isPlayer() and (spectatorsplagueroot[u]:getName() == player:getName()) then
                                player:teleportTo(Position(setting.kickPosition))
                                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
                            end
                        end
                end, 15 * 60 * 1000)
        end
    end
    return true
end
 
Solution
Lua:
local setting = {
    centerRoom = {x = 32207, y = 32047, z = 14},
    storage = Storage.DreamCourts.DreamScar.plaguerootTimer,
    Pillar1pos = {x = 32204, y = 32045, z = 14},
    bossPosition = {x = 32208, y = 32047, z = 14},
    kickPosition = {x = 32208, y = 32035, z = 13},
    playerTeleport = {x = 32207, y = 32052, z = 14}
}

local plaguerootLever = Action()

-- Start Script
function plaguerootLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 10030 and item.actionid == 30503 then
    local clearplaguerootRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)    
    for index, spectatorcheckface in ipairs(clearplaguerootRoom) do
        if spectatorcheckface:isPlayer() then
            creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
            return false
        end
    end
    for index, removeplagueroot in ipairs(clearplaguerootRoom) do
        if (removeplagueroot:isMonster()) then
            removeplagueroot:remove()
        end
    end
        Game.createMonster("Plagueroot", setting.bossPosition, false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
    local players = {}
    for i = 0, 4 do
         local player1 = Tile({x = (Position(item:getPosition()).x + 0) + 0, y = Position(item:getPosition()).y + 1 + i, z = Position(item:getPosition()).z}):getTopCreature()
        players[#players+1] = player1
    end
        for i, player in ipairs(players) do
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            player:teleportTo(Position(setting.playerTeleport), false)
            doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
            setPlayerStorageValue(player,setting.storage, os.time() + 20 * 60 * 60)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 15 minute(s) to defeat the boss.')
                addEvent(function()
                    local spectatorsplagueroot = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
                        for u = 1, #spectatorsplagueroot, 1 do
                            if spectatorsplagueroot[u]:isPlayer() and (spectatorsplagueroot[u]:getName() == player:getName()) then
                                player:teleportTo(Position(setting.kickPosition))
                                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
                            end
                        end
                end, 15 * 60 * 1000)
        end
    end
    return true
end

Lua:
local setting = {
    centerRoom = {x = 32207, y = 32047, z = 14},
    storage = Storage.DreamCourts.DreamScar.plaguerootTimer,
    Pillar1pos = {x = 32204, y = 32045, z = 14},
    bossPosition = {x = 32208, y = 32047, z = 14},
    kickPosition = {x = 32208, y = 32035, z = 13},
    playerTeleport = {x = 32207, y = 32052, z = 14}
}

local plaguerootLever = Action()

-- Start Script
function plaguerootLever.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 10030 and item.actionid == 30503 then
    local clearplaguerootRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)     
    for index, spectatorcheckface in ipairs(clearplaguerootRoom) do
        if spectatorcheckface:isPlayer() then
            creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
            return false
        end
    end 
    for index, removeplagueroot in ipairs(clearplaguerootRoom) do
        if (removeplagueroot:isMonster()) then
            removeplagueroot:remove()
        end
    end
        Game.createMonster("Plagueroot", setting.bossPosition, false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Attendant", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
        Game.createMonster("Plant Abomination", Position({x = setting.Pillar1pos.x + 6, y = setting.Pillar1pos.y + 4, z = setting.Pillar1pos.z}), false, true)
    local players = {}
    for i = 0, 4 do
         local player1 = Tile({x = (Position(item:getPosition()).x + 0) + 0, y = Position(item:getPosition()).y + 1 + i, z = Position(item:getPosition()).z}):getTopCreature()
        players[#players+1] = player1
    end
        for i, player in ipairs(players) do
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
            player:teleportTo(Position(setting.playerTeleport), false)
            doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
            setPlayerStorageValue(player,setting.storage, os.time() + 20 * 60 * 60)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 15 minute(s) to defeat the boss.')
                addEvent(function()
                    local spectatorsplagueroot = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
                        for u = 1, #spectatorsplagueroot, 1 do
                            if spectatorsplagueroot[u]:isPlayer() and (spectatorsplagueroot[u]:getName() == player:getName()) then
                                player:teleportTo(Position(setting.kickPosition))
                                player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
                                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
                            end
                        end
                end, 15 * 60 * 1000)
        end
    end
    return true
end
thanks bro if it worked for me
 
Back
Top