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

teleport to temple (using town ids)

wafuboe

Active Member
Joined
Dec 24, 2010
Messages
884
Solutions
2
Reaction score
26
well i need a script that, a magic forcefield will teleport you to your townid position. one only teleport diferent destination according to your townid temple.

o and another thing, how can i change the townid of all players at my database with one move, at once?
 
@wafuboe


Code:
function onStepIn(cid, item, position, fromPosition)
            doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
            doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    return true
end

Make sure to give the teleport an action id and add it to movements.xml

for the updating player towns in phpMyadmin execute this:

Code:
UPDATE `players` SET `town_id` = '2';

by default I set it to 2, which is Thais on my OT.

You can change 2 to whatever town you like.
 
thanks bro! :)

only a question.. how is the line to put on movement.xml ?


Let's say for example your Teleport action id is 65320 and let's say your script is named TownTeleport.lua

That path to your script should be like this: data/movements/TownTeleport.lua


And this is what you will put in your movements.xml
Code:
<movevent event="StepIn" actionid="65320" script="TownTeleport.lua" />
 
Back
Top