• Sign up for TFS Icon Competition! The prize includes Otland Premium time and a medal, as well as obviously taking part in TFS history.
  • 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 Movements Tile

adrenysny

Banned User
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Hello, help me with a script of a floor that asks you to have these items 37420 on and that you need a Storage and level 250 to transport you

ItemID: 37420
Level: 250
Storage: 284701

ITEMS PUESTO.png
 
Solution
Hello, help me with a script of a floor that asks you to have these items 37420 on and that you need a Storage and level 250 to transport you

ItemID: 37420
Level: 250
Storage: 284701

View attachment 57400
try
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local itemCount = player:getItemCount(config.ITEMID)
    if not itemCount or itemCount == 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')...

Snavy

Bakasta
Support Team
Joined
Apr 1, 2012
Messages
1,156
Solutions
59
Reaction score
468
Location
Hell
Hello, help me with a script of a floor that asks you to have these items 37420 on and that you need a Storage and level 250 to transport you

ItemID: 37420
Level: 250
Storage: 284701

View attachment 57400
try
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local itemCount = player:getItemCount(config.ITEMID)
    if not itemCount or itemCount == 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end
    -- Success, do something.
    position:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
 
Solution
OP
A

adrenysny

Banned User
Joined
Feb 17, 2021
Messages
140
Reaction score
14
try
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local itemCount = player:getItemCount(config.ITEMID)
    if not itemCount or itemCount == 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end
    -- Success, do something.
    position:sendMagicEffect(CONST_ME_TELEPORT)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
I'm missing the coordinate hahaha, can you help me?

{x = 32962, y = 31499, z = 7}
 

Snavy

Bakasta
Support Team
Joined
Apr 1, 2012
Messages
1,156
Solutions
59
Reaction score
468
Location
Hell
can it be placed to take you to another place? that takes you to this position {x = 32962, y = 31499, z = 7}
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701,
    DESTINATION = Position(32962, 31499, 7)
}

local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local itemCount = player:getItemCount(config.ITEMID)
    if not itemCount or itemCount == 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end

    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end

    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end

    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end

me:aid(config.TILE_ACTION_ID)
me:register()
 
OP
A

adrenysny

Banned User
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701,
    DESTINATION = Position(32962, 31499, 7)
}

local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local itemCount = player:getItemCount(config.ITEMID)
    if not itemCount or itemCount == 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end

    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end

    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end

    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end

me:aid(config.TILE_ACTION_ID)
me:register()
Bro can it be placed that can be passed only with the item placed as in the photo?
 

Attachments

Snavy

Bakasta
Support Team
Joined
Apr 1, 2012
Messages
1,156
Solutions
59
Reaction score
468
Location
Hell
Bro can it be placed that can be passed only with the item placed as in the photo?
Try
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701,
    DESTINATION = Position(32962, 31499, 7)
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local armor = player:getSlotItem(CONST_SLOT_ARMOR)
    if not armor or armor:getId() ~= config.ITEMID then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end
    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
 
OP
A

adrenysny

Banned User
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Post automatically merged:

Try
Lua:
local config = {
    TILE_ACTION_ID = 12345,
    ITEMID = 37420,
    LEVEL = 200,
    STORAGE = 284701,
    DESTINATION = Position(32962, 31499, 7)
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local armor = player:getSlotItem(CONST_SLOT_ARMOR)
    if not armor or armor:getId() ~= config.ITEMID then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required item.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be atleast level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have the required storage.')
        player:teleportTo(fromPosition)
        return true
    end
    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
Lua:
> Teleportvengoth.lua [error]
^ ...rgottenserver/data/scripts/movements/Teleportvengoth.lua:16: ')' expected near 'pass'


file.
Lua:
local config = {
    TILE_ACTION_ID = 52640,
    ITEMID = 37420,
    LEVEL = 250,
    STORAGE = 284723,
    DESTINATION = Position(33650, 31444, 10)
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local armor = player:getSlotItem(CONST_SLOT_ARMOR)
    if not armor or armor:getId() ~= config.ITEMID then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need burial shroud to pass.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to kill Thaian.')
        player:teleportTo(fromPosition)
        return true
    end
    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
 
Last edited:

Snavy

Bakasta
Support Team
Joined
Apr 1, 2012
Messages
1,156
Solutions
59
Reaction score
468
Location
Hell
Post automatically merged:


Lua:
> Teleportvengoth.lua [error]
^ ...rgottenserver/data/scripts/movements/Teleportvengoth.lua:16: ')' expected near 'pass'


file.
Lua:
local config = {
    TILE_ACTION_ID = 52640,
    ITEMID = 37420,
    LEVEL = 250,
    STORAGE = 284723,
    DESTINATION = Position(33650, 31444, 10)
}
local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local armor = player:getSlotItem(CONST_SLOT_ARMOR)
    if not armor or armor:getId() ~= config.ITEMID then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need burial shroud to pass.')
        player:teleportTo(fromPosition)
        return true
    end
    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end
    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to kill Thaian.')
        player:teleportTo(fromPosition)
        return true
    end
    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end
me:aid(config.TILE_ACTION_ID)
me:register()
Works fine over here.
Lua:
local config = {
    TILE_ACTION_ID = 52640,
    ITEMID = 37420,
    LEVEL = 250,
    STORAGE = 284723,
    DESTINATION = Position(33650, 31444, 10)
}

local me = MoveEvent('scriptNameHere')
function me.onStepIn(player, item, position, fromPosition)
    local armor = player:getSlotItem(CONST_SLOT_ARMOR)
    if (not armor) or (armor:getId() ~= config.ITEMID) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need burial shroud to pass.')
        player:teleportTo(fromPosition)
        return true
    end

    if player:getLevel() < config.LEVEL then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to be level ' .. config.LEVEL)
        player:teleportTo(fromPosition)
        return true
    end

    if player:getStorageValue(config.STORAGE) <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You need to kill Thaian.')
        player:teleportTo(fromPosition)
        return true
    end

    position:sendMagicEffect(CONST_ME_TELEPORT)
    player:teleportTo(config.DESTINATION)
    return true
end

me:aid(config.TILE_ACTION_ID)
me:register()
 
Top