• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Step tile give storage, have storage use teleport

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
Well i need a script so if someone steps on a tile it will appear a message and give a storage..

Also a teleport that cant teleport you unless yo have a storage
 
Solution
should work on [1.2] try this teleport:
LUA:
local config = {
    storage = 55666, -- storage the same in 2scripts
    position = Position(32345, 31801, 7) -- teleport to pos
}

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local targetPosition = (item.actionid)
    if not targetPosition then
        return true
    end
 
    if player:getStorageValue(config.storage) < 1 then
        player:teleportTo(fromPosition)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have access to this area.')
        return true
    end
        player:teleportTo(config.position)...
should work on [1.2] try this teleport:
LUA:
local config = {
    storage = 55666, -- storage the same in 2scripts
    position = Position(32345, 31801, 7) -- teleport to pos
}

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    local targetPosition = (item.actionid)
    if not targetPosition then
        return true
    end
 
    if player:getStorageValue(config.storage) < 1 then
        player:teleportTo(fromPosition)
        player:sendTextMessage(MESSAGE_STATUS_SMALL, 'You don\'t have access to this area.')
        return true
    end
        player:teleportTo(config.position)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    return true
end

step sqm:
LUA:
local config = {
    storage = 55666 -- storage the same in 2scripts
}

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end
 
    local sqmPosition = (item.actionid)
    if not sqmPosition then
        return true
    end
 
    if player:getStorageValue(config.storage) < 1 then
        player:setStorageValue(config.storage, 1)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Tekst MSG.') -- you can use another msg function
    end
    return true
end

movments.xml:
XML:
    <movevent event="StepIn" actionid="your tp actionID" script="script name tp.lua" />
    <movevent event="StepIn" actionid="your sqm actionID" script="script name sqm.lua" />
 
Last edited:
Solution
Back
Top