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

Script To Make you Binded to home town

hungthug

New Member
Joined
Oct 28, 2013
Messages
15
Reaction score
0
I know binded is not the right word, but i can't think of it right now. I'm looking for a script that when you walk through it that is now your town. I don't know what it would be called, so i can't search for it. please help! :)
 
Something like this?
Code:
function onStepIn(cid, item, position, fromPosition)
    if(item.actionid > 30020 and item.actionid < 30100) then
        local townId = (item.actionid - 30020)
        doPlayerSetTown(cid, townId)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest resident of " .. getTownName(townId) .. ".")
    end
    return true
end

You can find it in movements/scripts/citizen.lua
WibbenZ
 
you can also do it the way i've done it.

make a movement lua for each city this one is for thais so its ext is Thais_Citizen.lua

Code:
function onStepIn(cid, item, pos)
 
local thais = {x=32369, y=32241, z=7}
 
    if item.actionid == 30023 then
        doPlayerSetTown(cid,3)
        doTeleportThing(cid,thais)
        doSendMagicEffect(getCreaturePosition(cid),12)
        doCreatureSay(cid, "You are now a citizen of Thais", TALKTYPE_ORANGE_1)
        end
    return 1
end

then this in your movements.xml
Code:
<movevent type="StepIn" actionid="30023" event="script" value="Hometown/Thais_Citizen.lua" />

after you have set the script up now all you have to do is go into your map editor and set it up.
to do so select a raw teleport, place where you want. select its properties then type the action id to that teleport. no need to set a position on the teleport, the script does the teleport for you!

hope this helps! :D
 
you can also do it the way i've done it.

make a movement lua for each city this one is for thais so its ext is Thais_Citizen.lua

Code:
function onStepIn(cid, item, pos)

local thais = {x=32369, y=32241, z=7}

    if item.actionid == 30023 then
        doPlayerSetTown(cid,3)
        doTeleportThing(cid,thais)
        doSendMagicEffect(getCreaturePosition(cid),12)
        doCreatureSay(cid, "You are now a citizen of Thais", TALKTYPE_ORANGE_1)
        end
    return 1
end

then this in your movements.xml
Code:
<movevent type="StepIn" actionid="30023" event="script" value="Hometown/Thais_Citizen.lua" />

after you have set the script up now all you have to do is go into your map editor and set it up.
to do so select a raw teleport, place where you want. select its properties then type the action id to that teleport. no need to set a position on the teleport, the script does the teleport for you!

hope this helps! :D

Loved it. Thanks a lot big bro. Worked pperfect.
 
local thais = {x=32369, y=32241, z=7}
doTeleportThing(cid,thais)

Did you change the position? And the name of the new town?
WibbenZ
 
Back
Top