• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.
Resource icon

Get Vocation doors with teleport TFS 1.4.2

No permission to download

MyksaND

Just DO ITTT!
Joined
Mar 5, 2020
Messages
31
Reaction score
12
MyksaND submitted a new resource:

Get Vocation doors with teleport TFS 1.4.5 - Doors give vocation with teleport

Install it in the actions.xml folder.
This system consists of doors that when you click on them, they give you a vocation and teleport you to a certain location, perfect for rookland or special lobbies.

Don't forget the registry <action itemid="putitemidhere" script="vocsdoors.lua"/> on actions.xml

I hope it helps you! My friend AI helped me a lot! xD

Read more about this resource...
 
MyksaND submitted a new resource:

Get Vocation doors with teleport TFS 1.4.5 - Doors give vocation with teleport



Read more about this resource...

Here's a cleaner version.
LUA:
local config = {
--[actionId] = {vocationId = #, destination = Position(x, y, z)},
    [40000] = {vocationId = 1, destination = Position(855, 704, 7)},
    [40001] = {vocationId = 2, destination = Position(859, 704, 7)},
    [40002] = {vocationId = 3, destination = Position(863, 704, 7)},
    [40003] = {vocationId = 4, destination = Position(867, 704, 7)}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getVocation():getId() ~= 0 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You already have a vocation.")
        return true
    end
 
    local index = config[item:getActionId()]
    if not index then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "This door does not assign any vocation.")
        return true
    end
 
    local vocation = Vocation(index.vocationId)
    player:setVocation(vocation)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been assigned to the " .. vocation:getName() .. " vocation.")
    player:teleportTo(destination)
    return true
end
 
Thanks bro, I appreciate that you improved my script. It will be another option in case the user does not like my script.
 

Attachments

Back
Top