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

Talkactions Teleport

DiegoRulez

Member
Joined
Apr 16, 2012
Messages
93
Reaction score
11
Location
Feira de Santana - Brasil
TFS 1.2
I do not know if it is possible, but I would like a teleport talkactions. I would like to teleport to the uniqIDs of the server. My server has many quests, and I need to test one by one, this will only speed up my task.
Would you like something like /tp 2031
Where 2031 = uniqid

Thank you: D
 
I don't think this is a feasible thing to do.
You'd literally have to scan your entire map for the uniqueID.. which could be literally hundreds of thousands of items/tiles.

Your best thing would be to open your map editor, and find the position of the quest, and do like..
/goto 1000, 1000, 7
 
Never said they'd give a conflict, I'm just saying it freeze your server for like 30 minutes each time you used the talkaction to teleport your gm, because you don't know the position of the UID beforehand.

You either need to setup the positions for the UID in the talkaction.. which would be pointless for what your trying to do..

Or you'd want to open up the map editor and
A) find the UID using edit -> find on map -> unique
B) copy-paste the co-ordinates, and use the /goto command.

Or, you can scan every item and tile on the map for the UID you've written in your talkaction
A) /tp 2301
B) go take 6 coffee breaks while your computer crashes.
 
Or you could parse through the OTBM file ONCE and find the unique ids and write them as config and just make a teleport talkaction that goes to those positions.
 
Lua:
function onSay(player, words, param)
    if player:getAccountType() ~= ACCOUNT_TYPE_GOD then
        return false
    end
   
    local uid = tonumber(param)
    if not uid then
        player:sendCancelMessage('Please enter a UID: /tp UID')
        return false
    end
   
    local pos = getThingPos(uid)
    if not pos then
        player:sendCancelMessage('Pos for --> UID: ' .. uid .. ' <-- not found.')
        return false
    end   
   
    -- because of movements/scripts/walkback.lua, can't tp onto containers
    if Container(uid) then
        pos = Position(pos.x, pos.y+2, pos.z)
    end
   
    player:teleportTo(pos, true)
    return false
end
 
Back
Top