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

Lua Easy lua help How to make something teleport somewhere?

Sir Shutter

Learning LUA
Joined
Nov 17, 2008
Messages
1,437
Reaction score
10
Location
Egypt
Hey guys i want to make the "Nature Orb" search for it on your map editor i want it to teleport a player somewhere when he move on it to teleport him like the normal blue teleport.. can you put me a script that like il make a natural orb teleport somewhere if i move on it just post the script down here and like if you make position x= y= z= just type any number and type --------> Edit so i will know that i should edit where it goes also for the ID of natural orb you can do like if.item.itemid=="NATURAL ORB ID HERE" then --> etc.. just need u make like that really need this script

easy ya but i dont know codes im not a scripter xD
 
movements.xml:
PHP:
<movevent event="StepIn" itemid="ITEM ID OF ORB" script="orb.lua"/>

orb.lua:
PHP:
function onStepIn(cid, item, position, fromPosition)
local tppos = {x=POS X HERE, y=POS Y HERE, z=POS Z HERE} 
	if item.id == ITEM ID OF ORB and isPlayer(cid) == TRUE then
	doTeleportThing(cid, tppos, FALSE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You was teleported bla bla bla")
	end
	return TRUE
end


I'm not sure what it will work this way, if no then try this one:
make uniqueid of orb to 15050(for example).
movements.xml:
PHP:
<movevent event="StepIn" uniqueid="15050" script="orb.lua"/>

orb.lua:
PHP:
function onStepIn(cid, item, position, fromPosition)
local tppos = {x=POS X HERE, y=POS Y HERE, z=POS Z HERE} 
	if item.uid == 15050 and isPlayer(cid) == TRUE then
	doTeleportThing(cid, tppos, FALSE)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "bla bla bla")
	end
	
	return TRUE
end

this way, I almost sure what it will work :>
 
Not sure if that'd work. If not, then swtich to
Code:
item.itemid == ITEM ID

i think item.id == item.itemid ;>

I'm not sure what it will work, becouse this item is moveable, and we used itemid. Anyway it must work with both scripts :>
 
i wanna use this script for the carpet when you step in you will be teleported. can you guys add a pos location for the carpet please

thanks in advance
 
Just use this script from Fare-Fray:

PHP:
function onStepIn(cid, item, position, fromPosition)
local tppos = {x=POS X HERE, y=POS Y HERE, z=POS Z HERE} 
    if item.actionid == 15050 and isPlayer(cid) == TRUE then
    doTeleportThing(cid, tppos, FALSE)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "bla bla bla")
    end
    
    return TRUE
end

Then add it to movements.xml like this:

PHP:
<movevent event="StepOut" actionid="15050" script="telecreate.lua"/>

Then just add in mapeditor to the floor u whant the actionid: 15050
 
Back
Top