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

Solved Scripts City Residence

darksta

New Member
Joined
Feb 10, 2010
Messages
39
Reaction score
0
Hello,
when I use the following scripts, sends me to a dark place and gives debug the ot
something bad with the scripts?
hope helps

Code:
function onUse(cid, item, frompos, item2, topos)

    if getPlayerVocation(cid) > 0 then  -- city empadronarse
        newpos = {x=701, y=737, z=8}
        doPlayerSetMasterPos(cid, newpos)
        doPlayerSendTextMessage(cid,22,"Now you live in New Island.")
        doTeleportThing(cid,newpos)
        doSendMagicEffect(newpos,12)
        return 1
    else
        doPlayerSendTextMessage(cid,22,"Sorry, you dont have a vocation.")
        return 0
    end
end
 
Code:
<movevent type="StepIn" actionid="8609" event="script" value="test.lua"/>
Code:
local newpos, townid = {x = 701, y = 737, z = 8}, 1

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
   if getPlayerVocation(cid) < 1 then
      return doTeleportThing(cid, fromPosition), doPlayerSendCancel(cid, "Sorry, you dont have a vocation."), doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT), false
   end

   doTeleportThing(cid, newpos)
   doPlayerSetTown(cid, townid)
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now you live in New Island.")
   doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
   return true
end
 
Last edited:
Code:
local townId = 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getPlayerVocation(cid) < 1 then
      return doPlayerSendCancel(cid, "Sorry, you dont have a vocation."), doSendMagicEffect(getThingPos(cid), CONST_ME_POFF), false
   end

   doPlayerSetTown(cid, townId)
   doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Now you live in New Island.")
   doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
   return true
end

which would put these coordinates?
newpos = {x=701, y=737, z=8}

these are the ones that send me then I go to teleport city residence
 
Edited my previous post, it will now send you to newpos location upon use.
 
Edited my previous post, it will now send you to newpos location upon use.

in rm
I put the action will only go in the teleport?
at destination, not placed anything?
because if I leave it at zero, so as in the picture the teleport does not work: s

16915qt.jpg
 
If you are going to use teleport then use onStepIn (moveevent). :p

Teleports to 701, 737, 8 and sets player town id to 1 currently.

- edited -

Updated my previous post to onStepIn instead of onUse.
 
Last edited:
If you are going to use teleport then use onStepIn (moveevent). :p

Teleports to 701, 737, 8 and sets player town id to 1 currently.
I do not understand: c
could you give me an example, to apply, I have like 10 citys in my ot: c

and if you use action that would wipe the id and scripts?
 
it's just teleport position and town id that you need to adjust.

Each city got their own ID
------
local newpos, townid = {x = 701, y = 737, z = 8}, 1
 
Last edited:
Back
Top