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

[HELP ME] 1v1 Arena (Almost done with my OT) :D

Lopaz

Member
Joined
Sep 1, 2010
Messages
50
Reaction score
5
Location
https://otland.net/
Hello!

I need help with two things...
First: how do I make 2 people teleport to the location?
Let say one stands on a wooden floor switch on the left. In the middle there's a lever, and the other person stands on the right wooden floor switch.
When one of them pull the switch, they both get teleported to a location.
> Left Player: Position: [X: 1041] [Y: 988] [Z: 9].
> Right Player: Position: [X: 1052] [Y: 988] [Z: 9].

The wooden floor switch ItemID: [446]


And second: how do I make when one of them lose, both get teleported to Temple?
> Temple: Position: [X: 1000] [Y: 1000] [Z: 7].
 
Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 23232 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 23233 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end

Remember edit in Remeres map edito IDS..
23232 and 23233
 
Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 23232 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 23233 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end

Remember edit in Remeres map edito IDS..
23232 and 23233

That's just wrong in so many ways, actionIDs and destinations as entries? Specially actionIDs they don't make any sense at all :/
Try this, I forgot how to use the functions so they might be wrong.
Lua:
local positions = {
	entry = {
		{x=x,y=y,z=z},
		{x=x,y=y,z=z}
	},
	destination = {
		{x=1041,y=988,z=9},
		{x=1052,y=988,z=9}
	}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
var = 0
for i = 1, #positions.entry do
	if getTopCreature(positions.entry[i]).uid > 0 and isPlayer(getTopCreature(positions.entry[i])) then
		var = var + 1
	end
end
if var > 1 then
	for i = 1, #positions.destination do
		doTeleportThing(getTopCreature(positions.entry[i]).uid, positions.destination[i])
	end
else
	return false
end
return doTransformItem(item.uid, item.itemid == 446 and 447 or 446) and true
end
 
Hm, i'm a such a noob but just to be sure... Santi, where should I put the .lua script?


- - - Updated - - -

Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 23232 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 23233 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end

Remember edit in Remeres map edito IDS..
23232 and 23233


Cronox, your script didn't work. Cant even walk on the wooden floor switch.
The tile seems to be protected against unwanted intruders.


EDIT: Posted a screenshot. Should be easier to understand now :)
The gold coin means where their destination is.
Tibia.jpg

- - - Updated - - -

Bump; help please. ++Rep to the one that can help me :)

- - - Updated - - -

Help someone?

- - - Updated - - -

Please help ^_^
Stupid wooden floor switch that wont work :p
 
Last edited:
Is why I used action id made by you have
Is Actionid other script have you added
for changed go to actions.xml
try use this
data/actions open actions.xml and paste this
Lua:
<action actionid="4581;4582" script="name.lua"/>
now go to data/actions/scripts and created archive .lua , remember name its optional only edit name.lua for other..
Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 4581 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 4582 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end

Now for Works need open Remeres map editor go to switch and add action id
4581 and other switch 4582
Example:
Switch 1. Switch2
4581 4582

Understand?
Remember.. 4581 and 4582 is actionid yes your changed for other actionid need edit in script
4581 and 4582 for other actionid like you same in Remeres map editor
 
Is why I used action id made by you have
Is Actionid other script have you added
for changed go to actions.xml
try use this
data/actions open actions.xml and paste this
Lua:
<action actionid="4581;4582" script="name.lua"/>
now go to data/actions/scripts and created archive .lua , remember name its optional only edit name.lua for other..
Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 4581 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 4582 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end

Now for Works need open Remeres map editor go to switch and add action id
4581 and other switch 4582
Example:
Switch 1. Switch2
4581 4582

Understand?
Remember.. 4581 and 4582 is actionid yes your changed for other actionid need edit in script
4581 and 4582 for other actionid like you same in Remeres map editor

I did everything as you said, I can't even walk on the tile now.
I'll put a screenshot :p
Tile switch.jpg

Your screenshot say not found.

EDIT: reuploaded the pic
 
Last edited:
Your screenshot say not found.

- - - Updated - - -

lol is why your TILE.. have ID -.^..
remove ID - action or uniqueid in tile.. actionid for works is in switch
remove id in tile in RME.. click in tile actionid 0 - uniqueid 0.

- - - Updated - - -

HERE YOU GO EXAMPLE FULL - IMAGE:
imagen.jpg
 
Last edited:
Your screenshot say not found.

- - - Updated - - -

lol is why your TILE.. have ID -.^..
remove ID - action or uniqueid in tile.. actionid for works is in switch
remove id in tile in RME.. click in tile actionid 0 - uniqueid 0.

- - - Updated - - -

HERE YOU GO EXAMPLE FULL - IMAGE:
View attachment 15253

That works too, but I think you missunderstood what I needed help with... But if your works, i'll remap mine to look like yours.
Let say one stands on a wooden floor switch on the left. In the middle there's a lever, and the other person stands on the right wooden floor switch.
When one of them pull the switch, they both get teleported to a location.

- - - Updated - - -

And hey Cronox... it doesn't work :/
 
Last edited:
In tile.. not are nothing actionid or uniqueid need remove actionid or uniqueid open Remeres map editor, your map search where you have map.. and edit tile
and add actionid same picture..
 
I already did... I did everything as you said ;/
It still doesn't work <_<

- - - Updated - - -

Help please ^_^

- - - Updated - - -

Well, shit. I will never finish this thing <_<
 
Last edited:
Listen.. Delete your zone.. or create other ¬¬ why you have error in tile.. made by you get actionid other script in this tile..
you Open RME? go to your zone.. and see have actionid tile?
 
Listen.. Delete your zone.. or create other ¬¬ why you have error in tile.. made by you get actionid other script in this tile..
you Open RME? go to your zone.. and see have actionid tile?

You want me to make screenshot on everything so you can see? All the .lua files and the switch in RME etc. I really need help with this :(.
It just wont work...
 
Try Maping other zone same.. this arena is in VENORE not?
this arena have scripts.. added

No, it's my custom map. I'll give you my .lua files, some screen shots etc. in a sec :)

Data/Actions/actions.xml
XML:
<actions>
	<!-- Quests -->
	<action actionid="4581;4582" script="arena.lua"/>

Data/Actions/Scripts/arena.lua
Lua:
local tpPos1 = {x=1041,y=988,z= 9}
local tpPos2 = {x=1052,y=988,z= 9}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local Ppos = getCreaturePosition(cid) 
if item.itemid == 446 then
	return doTransformItem(item.uid, item.itemid - 1)
end
if item.itemid == 446 then
	if item.actionid == 4581 then
		if Ppos.x ~= tpPos1.x or Ppos.y ~= tpPos1.y or Ppos.z ~= tpPos1.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos2)
	elseif item.actionid == 4582 then
		if Ppos.x ~= tpPos2.x or Ppos.y ~= tpPos2.y or Ppos.z ~= tpPos2.z then
			return doPlayerSendCancel(cid, 'Not in the correct position') and false
		end
		doTeleportThing(cid, tpPos1)
	end
doTransformItem(item.uid, item.itemid + 1)
end
return true
end


Screenshot:
arena.jpg
 
Last edited:
area is same venore xd! remove and create other area.. why this arena is bad try use other area for see is error my script or area
 
Normally it works if you use a quest door and set the actionid to the storage the player needs to pass.

Post the doors.lua (actions/scripts/other)
 
Back
Top