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

[Help] with teleport

Sean Larson

New Member
Joined
Oct 22, 2007
Messages
99
Reaction score
1
Location
Colorado
I need a teleport that changes peoples residence can someone please help thank you.... Also if someone could help me come up with some kind of spell scroll i would really appreciate it
 
Code:
function onStepIn(cid, item, position, fromPosition)
 if item.actionid > 30020 and item.actionid < 30100 then
  doPlayerSetTown(cid, item.actionid - 30020)
 end
 return TRUE
end

not mine script...
only put actionid on teleport .. > 30020 and < 30100
if you want player residence TOWN1 .. put 30021..
u can change actionids if you want.
 
that just changes there residence of the town tho, not there master position so if they die they still go back to town 1

TownID is MasterPos, so if someone go to tp with AID 30022 after his death he will be teleported to town with ID 2. Easy as this.
 
So I am lost but this sounds like what I am looking for. In short I want a teleporter in each of my town's temples that makes it so when the player walks into it, from that point forward when they die or bug they return to the temple they chose. I am very new so all detail would be great ... the file types the locations and script? IF this is posted somewhere else let me know I have been searching and this thread is the one I found that sounded close. I do get that you can set actions IDs on items in the map editor But after that I am clue less. Thanks much I am using the latest download of tfs from download page with mySQL database if that helps.
 
If you're using TFS it's already there, just change the ACTIONID of the portal to the proper ID.

Alright, so you have your towns set up as Town 1, Town 2, Town 3. Right? (SimOnes Mapeditor: Tools > Edit Towns). Say you want a portal that they walk through and it makes their residency "Town 1". Change the ACTIONID of the portal to '30021' (Right-click the portal)

Then add that script:

Code:
function onStepIn(cid, item, position, fromPosition)
 if item.actionid > 30020 and item.actionid < 30100 then
  doPlayerSetTown(cid, item.actionid - 30020)
 end
 return TRUE
end

To data/movements/scripts/. Name it "citizen.lua". Then go back to data/movements/ and edit 'movements.xml'.

Find this line:

<movevent event="StepIn" itemid="1387" script="citizen.lua"/>

If it is not there, put it there. Otherwise, you should be good! From there all you need to do is change the ACTIONID of the portal to (30022 for Town 2, 30023 for Town 3, etc). Easy enough, eh?
 
Last edited:
Back
Top