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

enchant teleport

Entral

C
Joined
May 1, 2009
Messages
371
Reaction score
0
Location
Sweden
Hello!
I got one request..
you know the teleport that u go through the thing and get tp to the encantment thing?
only sorc can pass 2 of them and druid can only pass 2...

any1 got this script?
gonna make it like real

Edit:
If you didnt understand :P The players shull walk over a tile and get teleported

Picture: This is how it will work
altarp.jpg
 
Last edited:
here it is lol
Code:
 --sorcerer and master sorcerers tp-
local id = 1000          
local place = {x=1001, y=1000, z=7}
--druid and elder druid tp--
local id2 = 2000           -- unique id you will set to item
local place2 = {x=1006, y=1000, z=7}    -- potition
function onStepIn(cid, item, position, fromPosition)
  if getPlayerLookDir(cid) == 0 then
     newdir = 2
  elseif getPlayerLookDir(cid) == 1 then
         newdir = 3
  elseif getPlayerLookDir(cid) == 2 then
         newdir = 0
  else
       newdir = 1
  end
  if item.actionid == id then
    if getPlayerVocation(cid) ~= 1 and 5 then
           doPlayerSendCancel(cid, "Only sorcerer's are alowed to pass!")
     doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id2 then
    if getPlayerVocation(cid) ~= 2 and 6 then
           doPlayerSendCancel(cid, "Only Druids are alowed to pass!")
       doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id then
    if getPlayerVocation(cid) == 1 and 5 then
       doTeleportThing(cid, place)
       doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
       doSendMagicEffect(getPlayerPosition(cid), 10)
    end
  end
  if item.actionid == id2 then
     if getPlayerVocation(cid) == 2 and 6 then
        doTeleportThing(cid, place2)
        doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
        doSendMagicEffect(getPlayerPosition(cid), 10)
     end
  end
end
hope it works.
 
Last edited:
seems pretty hard xD
only thing i want to, is when an druid/sorc/ms or ed, walks on a tile, they will get teleported to a place, 2 of em will only work for sorc, and the other 2 for druids
 
you will need to add these lines in movement.xml
Code:
 <movevent type="StepIn" actionid="1000" event="script" value="tele.lua"/>
 <movevent type="StepIn" actionid="2000" event="script" value="tele.lua"/>
Then creat a file in the movement-->script called "tele.lua"
and put this in it
Code:
--sorcerer and master sorcerers tp-
local id = 1000          
local place = {x=1001, y=1000, z=7}
--druid and elder druid tp--
local id2 = 2000           -- unique id you will set to item
local place2 = {x=1006, y=1000, z=7}    -- potition
function onStepIn(cid, item, position, fromPosition)
  if getPlayerLookDir(cid) == 0 then
     newdir = 2
  elseif getPlayerLookDir(cid) == 1 then
         newdir = 3
  elseif getPlayerLookDir(cid) == 2 then
         newdir = 0
  else
       newdir = 1
  end
  if item.actionid == id then
    if getPlayerVocation(cid) ~= 1 and 5 then
           doPlayerSendCancel(cid, "Only sorcerer's are alowed to pass!")
     doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id2 then
    if getPlayerVocation(cid) ~= 2 and 6 then
           doPlayerSendCancel(cid, "Only Druids are alowed to pass!")
     doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id then
    if getPlayerVocation(cid) == 1 and 5 then
     doTeleportThing(cid, place)
     doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
  doSendMagicEffect(getPlayerPosition(cid), 10)
 end
  end
  if item.actionid == id2 then
     if getPlayerVocation(cid) == 2 and 6 then
        doTeleportThing(cid, place2)
        doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
     doSendMagicEffect(getPlayerPosition(cid), 10)
     end
  end
end

look dude in rl there is like earth for sorcerer and ice for druids so here is the place where you edit in the script i gave you
Code:
 --sorcerer and master sorcerers tp-
local id = 1000          
local place = {x=1001, y=1000, z=7}
--druid and elder druid tp--
local id2 = 2000           -- unique id you will set to item
local place2 = {x=1006, y=1000, z=7}    -- potition

you see the place under--sorcerer$mastersorcerer--
Code:
--sorcerer and master sorcerers tp-
local id = 1000          
local place = {x=1001, y=1000, z=7}

the local id = 1000 this is the action id you will give to the tile or teleport
*How to set action id??*
in your map editor just right click on the tile or the teleport you want sorcerers/master sorc walk on it it will teleport them. Then click on properties.
A box will appear,with 3 bars in it:
count:
Actionid:*******
Unique id:

in the place where it says "Actionid" you will write the number 1000(which is for sorcerer and master sorcerer can only pass).

Then go back to your script in place where it says
Code:
local place = {x=1001, y=1000, z=7}
this you should change to the destination as you know evry place has its (x,y,z) so change the nubers beside the x,y,z to the place where player will be teleported too.

Same thing make it with the druids
Code:
--druid and elder druid tp--
local id2 = 2000           -- unique id you will set to item
local place2 = {x=1006, y=1000, z=7}    -- potition
give the tile or tp in map editor in the actionid place the number 2000,then go back to script to set the destination.
 
Last edited:
ok here you are this for elder druids and master sorcerers which are <lvl 30+>
and it send msg suits player conditions.

Code:
--sorcerer and master sorcerers tp-
local id = 1000          
local place = {x=1001, y=1000, z=7}
--druid and elder druid tp--
local id2 = 2000           -- unique id you will set to item
local place2 = {x=1006, y=1000, z=7}    -- potition
function onStepIn(cid, item, position, fromPosition)
  if getPlayerLookDir(cid) == 0 then
     newdir = 2
  elseif getPlayerLookDir(cid) == 1 then
         newdir = 3
  elseif getPlayerLookDir(cid) == 2 then
         newdir = 0
  else
       newdir = 1
  end
  if item.actionid == id then
    if getPlayerVocation(cid) ~= 5 and  getPlayerLevel(cid) >= 30 then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING,"Only Master Sorcerer's are alowed to pass!")
       doMoveCreature(cid, newdir)
	end
	if getPlayerVocation(cid) ~= 5 and getPlayerLevel(cid) < 30 then
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Only Master Sorcerers With lvl 30 over are allowed to pass!")
           doMoveCreature(cid, newdir)
    end
    if getPlayerVocation(cid) == 5 and getPlayerLevel(cid) < 30 then
	       doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Only lvl 30+ or over are allowed to pass!")
           doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id2 then
     if getPlayerVocation(cid) ~= 6 and  getPlayerLevel(cid) >= 30 then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Only Elder Druids are alowed to pass!")
       doMoveCreature(cid, newdir)
	end
	if getPlayerVocation(cid) ~= 6 and getPlayerLevel(cid) < 30 then
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Only Elder Druids With lvl 30 over are allowed to pass!")
           doMoveCreature(cid, newdir)
    end
    if getPlayerVocation(cid) == 6 and getPlayerLevel(cid) < 30 then
	       doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Only lvl 30+ or over are allowed to pass!")
           doMoveCreature(cid, newdir)
    end
  end
  if item.actionid == id then
    if getPlayerVocation(cid) == 5 and getPlayerLevel(cid) >= 30 then
       doTeleportThing(cid, place)
       doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
       doSendMagicEffect(getPlayerPosition(cid), 10)
    end
  end
  if item.actionid == id2 then
     if getPlayerVocation(cid) == 6 and getPlayerLevel(cid) >= 30 then
        doTeleportThing(cid, place2)
        doPlayerSendTextMessage(cid, TALKTYPE_MONSTER_YELL, "You are teleported to Enchanted Temple!")
        doSendMagicEffect(getPlayerPosition(cid), 10)
     end
  end
end
 
Shorter?
Code:
function onStepIn(cid, item, position, fromPosition)
	if (isDruid(cid) or isSorcerer(cid)) then
		doTeleportThing(cid, {x = , y = , z =})
	else
		doTeleportThing(cid, fromPosition, TRUE)
	end
	return true
end
 
Back
Top