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

Teleport for money TFS 1.2 (movements actionid)

dawido995

New Member
Joined
Jun 6, 2009
Messages
23
Reaction score
1
I'm looking for script "teleports for money". I have TFS 1.2
My script from 0.35 doesn't work.


Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/1cctpgrim.lua:onStepIn
data/movements/scripts/1cctpgrim.lua:3: attempt to call global 'hasCondition' (a nil value)
stack traceback:
        [C]: in function 'hasCondition'
        data/movements/scripts/1cctpgrim.lua:3: in function <data/movements/scripts/1cctpgrim.lua:1>
 
what?
you didn't say what you wanted properly
are you wanting a movement script that lets you teleport somewhere at a cost?
 
Code:
local config = {
    [1000] = {price = 200, newPosition = Position(1000, 1000, 7)},
    [1001] = {price = 300, newPosition = Position(2000, 2000, 7)},
}

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

    local tmpTile = config[item.actionid]
    if not tmpTile then
        return true
    end

    local price = tmpTile.price
    if not player:removeMoney(price) then
        player:sendCancelMessage(player, string.format('You must pay %d to enter in this teleport', price))
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    player:teleportTo(tmpTile.newPosition)
    return true
end

I don't know if is that what you are requesting. Please provide more information if not.
 
Back
Top