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

Teleport

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
hello =)!

i need a script,
a teleport if you are below 150 you go in a certain possition, and ir you are 151+ you go in other possition :P!
 
data/movements/scripts/tp.lua
LUA:
local pos = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 150-
local pos2 = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 151+

function onStepIn(cid, item, pos)
   if getPlayerLevel(cid) < 150 then
      doTeleportThing(cid,pos)
   elseif getPlayerLevel(cid) > 150 then
          doTeleportThing(cid,pos2)
   end
return true
end

data/movements/movements.xml
XML:
<movevent type="StepIn" uniqueid="5678" event="script" value="tp.lua"/>

Put 5678 in the tp at RME and thats it.
Btw, if you're level 150 nothing will happen D:
 
LUA:
local pos = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 150-
local pos2 = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 151+
 
function onStepIn(cid, item, pos)
   if getPlayerLevel(cid) == 150 then
      doTeleportThing(cid,pos)
   elseif getPlayerLevel(cid) == 151 then
          doTeleportThing(cid,pos2)
   end
return true
end

Use this one
 
LUA:
local pos = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 150-
local pos2 = {x=EDIT, y=EDIT, z=EDIT} ---- Pos for 151+
 
function onStepIn(cid, item, pos)
   if getPlayerLevel(cid) <= 150 then
      doTeleportThing(cid,pos)
   elseif getPlayerLevel(cid) >= 151 then
          doTeleportThing(cid,pos2)
   end
return true
end

You forgot : > and <
 
LUA:
local t = {
	[{1,150}] = {x=100, y=100, z=7},
	[{151,math.huge}] = {x=100, y=100, z=7}
}

function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		local lvl = getPlayerLevel(cid)
		for k, v in pairs(t) do
			if lvl >= k[1] and lvl <= k[2] then
				return doTeleportThing(cid, v) and doSendMagicEffect(v, CONST_ME_TELEPORT)
			end
		end
	end
end
 
LUA:
local t = {
	[{1,150}] = {x=100, y=100, z=7},
	[{151,math.huge}] = {x=100, y=100, z=7}
}

function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		local lvl = getPlayerLevel(cid)
		for k, v in pairs(t) do
			if lvl >= k[1] and lvl <= k[2] then
				return doTeleportThing(cid, v) and doSendMagicEffect(v, CONST_ME_TELEPORT)
			end
		end
	end
end

Show off. :(

Hunted!
 
Back
Top