• 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 Lvl Pass

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
hello someone help me with this script, I want you to ask for level 300 to pass

Lua:
local config = {
    [26828] = Position(33876, 31884, 8),
}

local stone = Action()

function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    for actionId, destination in pairs(config) do
        if item.actionid == actionId then
            player:teleportTo(destination)
            destination:sendMagicEffect(CONST_ME_TELEPORT)
            fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
            return true
        end
    end
end

stone:aid(26828)
stone:register()
 
Solution
Try this. ( haven't tested )

Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8)
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

stone:aid(26828)
stone:register()

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,245
Solutions
71
Reaction score
583
Location
Hell
Try this. ( haven't tested )

Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8)
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

stone:aid(26828)
stone:register()
 
Solution
OP
OP
A

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Try this. ( haven't tested )

Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8)
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

stone:aid(26828)
stone:register()
thanks bro, yes it worked
Post automatically merged:

Try this. ( haven't tested )

Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8)
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

stone:aid(26828)
stone:register()
Try this. ( haven't tested )

Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8)
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

stone:aid(26828)
stone:register()
bro can you add a 2 second exhaust?
 

Snavy

Bakasta
Senator
Joined
Apr 1, 2012
Messages
1,245
Solutions
71
Reaction score
583
Location
Hell
add a 2 second exhaust
Try, haven't tested. Let me know if it works.
Lua:
local config = {
    requiredLevel = 300,
    destination = Position(33876, 31884, 8),
    exhaustionId    = 12345 -- might need to change later
    exhaustionDelay = 2     -- seconds
}

local stone = Action()
function stone.onUse(player, item, fromPosition, itemEx, toPosition)
    local exhaustion = player:getStorageValue(config.exhaustionId)
    if exhaustion and exhaustion > os.time() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are doing that too fast.")
        return true
    end

    if player:getLevel() < config.requiredLevel then
        fromPosition:sendMagicEffect(CONST_ME_POFF)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need to be atleast level " .. config.requiredLevel .. " to use this item.")
        return true
    end

    player:teleportTo(config.destination)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    fromPosition:sendMagicEffect(CONST_ME_TELEPORT)
    player:setStorageValue(config.exhaustionId, os.time() + config.exhaustionDelay)

    return true
end

stone:aid(26828)
stone:register()
 
Top