• 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 level.

Faraonekkk

New Member
Joined
Feb 15, 2010
Messages
686
Reaction score
4
is it possible to do teleport level?
i mean if i put in actionid teleport (1050) so he will tp only ppls with 50 lvl+?
 
Code:
local id = 11111 --this is the action id u need to edit to the item in map editor
function onStepIn(cid, item, position, fromPosition)
if item.actionid == id and getPlayerLevel(cid) >= 50 then
doTeleportThing(cid, place)
doSendMagicEffect(getPlayerPosition(cid), 37)
elseif item.actionid ~= id then

          end
 retirm true
end

Tell me if it works, thanks
 
Last edited:
Add in movements.xml as actionID you want and not itemid :)

Edit: relized now that you wanted a teleport not a normal tile xD try this:
LUA:
local tpTo = {x = 1000, y = 1000, z = 7} -- Place to teleport the player to
local AID = 11111 -- ActionID

function onStepIn(cid, item, position, fromPosition)
     if(item.actionid ~= AID) then
           return true
     end
        if(getPlayerLevel(cid) >= 50) then
		doTeleportThing(cid, tpTo)
		doSendMagicEffect(getPlayerPosition(cid), 37)
        else
                doTeleportThing(cid, fromPosition)
	end
	return true
end

EDIT; now it should fully work
 
Last edited:
to Milice

i added in movements:
<movevent type="StepIn" actionID="11111" event="script" value="teleporta.lua"/>
on map i added in teleport action id 11111
and its not working :P

to Joepod
i added in actions.xml

<action actionid="11111" script="teleporta.lua" />
and in teleport actionID = 11111
+ your script

and its not working too :P

maybe i did something wrong?
 
to Milice

i added in movements:

on map i added in teleport action id 11111
and its not working :P

to Joepod
i added in actions.xml


+ your script

and its not working too :P

maybe i did something wrong?

LUA:
local tpTo = {x = 1000, y = 1000, z = 7} -- Place to teleport the player to
 
function onStepIn(cid, item, position, fromPosition)
    if(getPlayerLevel(cid) >= 50) then
        doTeleportThing(cid, tpTo)
        doSendMagicEffect(getPlayerPosition(cid), 37)
        else
                doTeleportThing(cid, fromPosition)
    end
    return true
end

This part was a typo:
Code:
      doTeleportThing(cid, toTo)
to
Code:
      doTeleportThing(cid, tpTo)

And try using another actionid just to be sure and check if your not already using it somewhere ;p
 
try this one:
LUA:
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) and getPlayerLevel(cid) >= 50 then
        doTeleportThing(cid, {x=X, y=X, z=X}) -- Place to teleport the player to
        doSendMagicEffect(position, CONST_ME_TELEPORT)
    end
end

What distro do you use btw?
 
Lol, no error or anything?, just try to put itemid on it this time in movements.xml

u using 0.3.6pl1?

try this one too:
LUA:
function onStepIn(cid, item, position, fromPosition)
        if getPlayerLevel(cid) >= 50 then
            doTeleportThing(cid, {x = 111, y = 1111, z = 1}) -- Place to teleport the player to
            doSendMagicEffect({x = 111, y = 1111, z = 1}, 15) -- Place to to do the effect
        end
    return true
end

If this one don't work idk anymore haha.
 
Last edited:
<!-- Extras -->

<movevent type="StepIn" itemid="1387" actionID="11112" event="script"

value="seal1.lua"/>
<movevent type="StepIn" itemid="1387" actionID="11113" event="script"

value="seal2.lua"/>


and the script
local tpTo = {x = 868, y = 1070, z = 15} -- Place to teleport the player to

function onStepIn(cid, item, position, fromPosition)
if(getPlayerLevel(cid) >= 25) then
doTeleportThing(cid, tpTo)
doSendMagicEffect(getPlayerPosition(cid), 37)
else
doTeleportThing(cid, fromPosition)
end
return true
end



11112 is teleporting same as 11113 :P
 
try this one:
LUA:
local tpTo = {x = 868, y = 1070, z = 15} -- Place to teleport the player to

function onStepIn(cid, item, position, fromPosition)
if item.actionid == ACTIONID and(getPlayerLevel(cid) >= 25) then
doTeleportThing(cid, tpTo)
doSendMagicEffect(getPlayerPosition(cid), 37)
else
doTeleportThing(cid, fromPosition)
end
return true
end

and this in movements.xml
XML:
<movevent type="StepIn" itemid="1387" actionID="ACTIONID" event="script" value="yourfile.lua"/>

Change ACTIONID = an unused action id
change yourfile.lua = the name of your lua file
 
Back
Top