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

Lua vocation doors dont work tfs 1.3

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Hello guys, i have these vocation doors wich aparently dont work for players, but i have seen with my own eyes that for some players they work, these are 2 vocation doors, 1 for paladin and mages and other for knights and paladins.
If possible i would like this to work with teleporting the player to the other side of the door, check the scripts!


knight paladin
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not table.contains({3, 4, 7, 8}, player:getVocation():getId()) then
        player:teleportTo(fromPosition, true)
        return true
    end

    player:teleportTo(Position(x, y, z))
    return true
end

sorcerer, druid and paladins
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if not table.contains({1, 2, 5, 6, 3, 7}, player:getVocation():getId()) then
        player:teleportTo(fromPosition, true)
        return true
    end

    player:teleportTo(Position(x, y, z))
    return true
end


plz help :C
 
Is it possible that script is overwritten by default door script?
You can also try like:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if table.contains({3, 4, 7, 8}, player:getVocation():getId()) then
        player:teleportTo(Position(x, y, z))
        return true
    end
end
 
Is it possible that script is overwritten by default door script?
You can also try like:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if table.contains({3, 4, 7, 8}, player:getVocation():getId()) then
        player:teleportTo(Position(x, y, z))
        return true
    end
end
450ec7498d733cd56e0d88a656ff056e.png


nothing happens when i right click the doors, maybe im using the wrong door? nothing in console either
 
Why would they work if you are teleporting player to void?
player:teleportTo(Position(x, y, z)) this is nil xD
player:teleportTo(Position(1000, 1000, 7)) or whatever position
 
Why would they work if you are teleporting player to void?
player:teleportTo(Position(x, y, z)) this is nil xD
player:teleportTo(Position(1000, 1000, 7))
oh what i meant is teleport the player to the other side of the door D;
 
Back
Top