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

How can I create a teleport to become a resident in a city?

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Hello, my idea is to create an ot war 7.4, I have put a map of thais wars .. but it does not have teleports, the otserver that I am using is Avesta 063, it does not have an account manager, only an account tester .. how can I create in the temple a teleport that when you die return to the temple?

the server will be used, to practice only with my team ..

01.png
I have another question .. how can I create the other accounts, so as not to create the page from Sqlite
02.pngsta
 
In movements/scripts, copy any file and replace name with asigntemple.lua and content inside replace with:

Lua:
function onStepIn(cid, item, position, fromPosition)
    doPlayerSetTown(cid, 1)
    doPlayerSendTextMessage(cid, 22, "You are now citizen of NAME TOWN 1")
    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end


Then in movements.xml add this line:

Code:
<movevent type="StepIn" actionid="6770" event="script" value="asigntemple.lua"/>


Then in map editor asign to the floor that has the teleport over it the actionid 6770.
In map editor also asign the coordenates to your town 1 temple in MENÚ --> MAP--> EDIT TOWNS
 
In movements/scripts, copy any file and replace name with asigntemple.lua and content inside replace with:

Lua:
function onStepIn(cid, item, position, fromPosition)
    doPlayerSetTown(cid, 1)
    doPlayerSendTextMessage(cid, 22, "You are now citizen of NAME TOWN 1")
    doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
end


Then in movements.xml add this line:

Code:
<movevent type="StepIn" actionid="6770" event="script" value="asigntemple.lua"/>


Then in map editor asign to the floor that has the teleport over it the actionid 6770.
In map editor also asign the coordenates to your town 1 temple in MENÚ --> MAP--> EDIT TOWNS

console error
3.png
1.png

2.png
 
Try this one,

Lua:
local config = {
    [31272] = 1,
    [31273] = 2,
    [31274] = 3,
    [31275] = 4,
    [31276] = 5,
    [31277] = 7,
    [31278] = 8,
    [31279] = 9,
    [31280] = 10,
    [31281] = 11,
    [31282] = 12
}

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

    local town = Town(config[item.uid])
    local templePosition = town:getTemplePosition()
    player:setTown(town)
    player:teleportTo(templePosition)
    templePosition:sendMagicEffect(CONST_ME_TELEPORT)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now a citizen of ' .. town:getName() .. '.')
    return true
end
 
Try this one,

Lua:
local config = {
    [31272] = 1,
    [31273] = 2,
    [31274] = 3,
    [31275] = 4,
    [31276] = 5,
    [31277] = 7,
    [31278] = 8,
    [31279] = 9,
    [31280] = 10,
    [31281] = 11,
    [31282] = 12
}

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

    local town = Town(config[item.uid])
    local templePosition = town:getTemplePosition()
    player:setTown(town)
    player:teleportTo(templePosition)
    templePosition:sendMagicEffect(CONST_ME_TELEPORT)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You are now a citizen of ' .. town:getName() .. '.')
    return true
end
modern coding style in 7.4? i'am sure this is not tfs 1.X even 0.4

check movements/scripts file you might find it already added in the folder citizen.lua
 
Back
Top