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

1 way Tile?

SebbePwnyou

New Member
Joined
Jan 14, 2015
Messages
19
Reaction score
3
Hello Otland does anyone have a script that makes so if you walk on a tile you can't walk back?

An example: If I walk over a bridge, and turn around to walk back over I can not.

(edit) I'm using TFS 1.2 client 10.9
 
Last edited:
Solution
Thanks :) And I will probably keep it at reset every day, as it is for a daily quest.
Also is there a way to do it for older TFS versions as well like 0.3.7 or 0.4?
I'm not too good at earlier version but you can try this:
Lua:
has_walked = has_walked or {}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if not isPlayer(cid) then return true end
    
    if has_walked[cid] then
        doTeleportThing(cid, lastPosition, true)
    else
        has_walked[cid] = true
    end
    return true
end
Hello Otland does anyone have a script that makes so if you walk on a tile you can't walk back?

An example: If I walk over a bridge, and turn around to walk back over I can not.

(edit) I'm using TFS 1.2 client 10.9
Is it like, you always an walk north over tile but you can never walk south over it? Or first time you walk on it it'll flag for it not to be crossed again?
 
yeah walk on and it flags so you cant walk on it again
This will only work once per day. If you want it to be for forever let me know and I'll change it up.
Lua:
has_walked = has_walked or {}

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

    if has_walked[player.uid] then
        player:teleportTo(fromPosition, true)
    else
        has_walked[player.uid] = true
    end
    return true
end
 
Last edited:
Lua:
local has_walked = has_walked or {}

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

    if has_walked[player.uid] then
        player:teleportTo(fromPosition, true)
    else
        has_walked[player.uid] = true
    end
    return true
end
Make that table global, that trick will not work for local tables.
 
Thanks :) And I will probably keep it at reset every day, as it is for a daily quest.
Also is there a way to do it for older TFS versions as well like 0.3.7 or 0.4?
 
Thanks :) And I will probably keep it at reset every day, as it is for a daily quest.
Also is there a way to do it for older TFS versions as well like 0.3.7 or 0.4?
I'm not too good at earlier version but you can try this:
Lua:
has_walked = has_walked or {}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if not isPlayer(cid) then return true end
    
    if has_walked[cid] then
        doTeleportThing(cid, lastPosition, true)
    else
        has_walked[cid] = true
    end
    return true
end
 
Solution
Back
Top