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

[Request] StepIn teleport for TFS

Try that and tell me if working


tortoise.lua
Code:
local oldPos = {x = 221, y = 436, z = 7} -- where to step to be teleported
local newPos = {x = 195, y = 433, z = 7} -- position where the player will be teleported

function onStepIn(cid, item, pos)


    if isPlayer(cid) == TRUE then
            doSendMagicEffect(oldPos, CONST_ME_POFF)
            doTeleportThing(cid, newPos, TRUE)
            doSendMagicEffect(newPos, CONST_ME_TELEPORT)
            doRemoveItem(getItem.uid)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The teleport isn't activated.")
            doSendMagicEffect(oldPos, CONST_ME_POFF)
        end
    end
    return TRUE
end


and ofc
Code:
	<movevent event="StepIn" uniqueid="xxxx" script="tortoise.lua" />

add uniqueId = xxxx to tile where you have to step
 
tortoise.lua
Code:
local positions = {
    [actionid] = {x=195, y=433, z=7},
    [actionid2] = {x=174, y=284, z=7},
}

function onStepIn(cid, item, oldPos)
    if isPlayer(cid) == TRUE then
        local newPos = positions[item.actionid]
        if newPos then
            doSendMagicEffect(oldPos, CONST_ME_POFF)
            doTeleportThing(cid, newPos, TRUE)
            doSendMagicEffect(newPos, CONST_ME_TELEPORT)
        end
    end
    return TRUE
end

In movements.xml:
<movevent itemid="ITEMID_OF_THE_TORTOISE_TILE" script="tortoise.lua" />

And then you write like actionid 8908 on a tortoise tile and you'd write this in the script:
PHP:
    [8908] = {x=195, y=433, z=7},
And that positions is where you shall be TPed when you step in to the tile!
 
Last edited:
and "old pos" .. cuz i remade TP script :P ty for "fixing" :P

ops and i found somehtink ....
cuz in that script i had to have some item to be teleported.. but now
Code:
 doRemoveItem(getItem.uid)
can be deleted :PPP
 
Back
Top