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

Teleport from position

Na 5tyk

New Member
Joined
Sep 16, 2012
Messages
13
Reaction score
0
Hi,
I have code:
Code:
function wyrzuc(cid)
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
		if(getTopCreature({x=996, y=995, z=5})) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales :(")
		end
	end
end
and How to move a player from the {x=996, y=995, z=5} to {x=1000, y=1000, z=7}
 
LUA:
function wyrzuc()
    local cid = getTopCreature({x=996,y=995,z=5})
    local pos = {x=,y=,z=}
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
		if(doTeleportThing(cid, pos)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales :(")
		end
	end
end

Now to make sure the player is standing on a position, use
LUA:
if((getThingPos(cid).x == pos.x) and (getThingPos(cid).y == pos.y) and (getThingPos(cid).z == pos.z)) then
 
This code does not work.

After the addition of
Code:
doBroadcastMessage("Ser!", MESSAGE_EVENT_ADVANCE)
after
Code:
if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
It's OK.

But This code does not work
Code:
if(doTeleportThing(cid, pos)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales ")
		end


My code:
Code:
function wyrzucl()
	local cid = getTopCreature({x=996,y=995,z=5})
	local pos = {x=1002,y=1001,z=7}
	
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
	doBroadcastMessage("Ser!", MESSAGE_EVENT_ADVANCE)
		if(doTeleportThing(cid, pos)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales ")
		end
	end
end
 
Then try this,
LUA:
function wyrzucl()
	local cid = getTopCreature({x=996,y=995,z=5})
	local pos = {x=1002,y=1001,z=7}
	
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
	doBroadcastMessage("Ser!", MESSAGE_EVENT_ADVANCE)
		if((getThingPos(cid).x == pos.x) and (getThingPos(cid).y == pos.y) and (getThingPos(cid).z == pos.z)) then
                        doTeleportThing(cid, pos)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales ")
		end
	end
end
 
Just make in movements

LUA:
function onStepIn(cid, item, position, fromPosition)

		doTeleportThing(cid, {x = 101, y = 115, z = 7})
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome")
	return true
end

and xml

XML:
<movevent type="StepIn" actionid="18273" event="script" value="script.lua"/>

and action id on tile
 
Then try this,
LUA:
function wyrzucl()
	local cid = getTopCreature({x=996,y=995,z=5})
	local pos = {x=1002,y=1001,z=7}
	
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
	doBroadcastMessage("Ser!", MESSAGE_EVENT_ADVANCE)
		if((getThingPos(cid).x == pos.x) and (getThingPos(cid).y == pos.y) and (getThingPos(cid).z == pos.z)) then
                        doTeleportThing(cid, pos)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Niestety, przegrales ")
		end
	end
end
Again this code does not work.
 
I know nothing about that language he typed in (Polish?), so I can't understand what he wants to do with it...
I thought he was actually using the function inside an event script...
 
If a player is in front of me cheese it throws him to the temple (translate.google.com)


I don't know what actionid.

That actionid need to be on the tile the player walk on to get teleported.

Idk either if you search for this, just give it a shot lol
 
I know nothing about that language he typed in (Polish?), so I can't understand what he wants to do with it...
I thought he was actually using the function inside an event script...

Yes, Polish.
OK.
I wanted to if achieve that before the player is cheese it teleport him to temple.

- - - Updated - - -

error.JPG

My code:
Code:
function won()
	if(getTileItemById({x=996, y=997, z=5}, 2696).itemid == 2696) then
	doBroadcastMessage("Ser!", MESSAGE_EVENT_ADVANCE)
		if(getTopCreature({x=1002,y=1001,z=7})) then
			doTeleportThing(getTopCreature({x=1002,y=1001,z=7}), {x=1002,y=1001,z=7})
		end
	end
end

How repair?
 
Back
Top