Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Teleport frompos topos

Experienced Elementalist
Joined
Jul 29, 2012
Messages
240
Reaction score
25
Here is a script I made, it teleports u to 2 diff places and u can chose wich vocs can go on it

Code:
--Made by Amiroslo
local areas = {
    pos1 = {
        fromPos = {x=1, y=1, z=1},
        toPos = {x=1, y=1, z=1}
        },
    pos2 = {
        fromPos = {x=2, y=2, z=2},
        toPos = {x=2, y=2, z=2}
        }
    }
	
local voc = {1,2,3,4,5,6,7,8}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
   if isInArray(voc, getPlayerVocation(cid)) then
    doTeleportThing(cid, {x=math.random(areas.pos1.fromPos, areas.pos1.toPos), y=math.random(areas.pos1.fromPos, areas.pos1.toPos), z=math.random(areas.pos1.fromPos, areas.pos1.toPos)})
    doPlayerSendTextMessage(cid, 21, "You have been teleported to room1")
   elseif isInArray(voc, getPlayerVocation(cid)) then
    doTeleportThing(cid, {x=math.random(areas.pos2.fromPos, areas.pos2.toPos), y=math.random(areas.pos2.fromPos, areas.pos2.toPos), z=math.random(areas.pos2.fromPos, areas.pos2.toPos)})
	doPlayerSendTextMessage(cid, 21, "You have been teleported to room2")
   else
    doPlayerSendCancel(cid, "Sorry you cant enter here!.")
   end
   return true
end

in movements.xml
Code:
	<movevent type="stepIn" actionid="CHOSE AN ID" event="script" value="script.lua"/>

Not tested, Report bugs!
 
Back
Top