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

Solved!

Lua:
count = 0 -- global variable to count players
local amount = 2 -- the required amount of players to step in the tiles
local walls = -- walls positions
	{
		{x=123, y=123, z=7, stackpos=1},
		{x=123, y=123, z=7, stackpos=1},
		{x=123, y=123, z=7, stackpos=1},
	}
local id = 1234 -- wall id
function onStepIn(cid, item, frompos, item2, topos)
	count = count + 1
	doTransformItem(item.uid, item.itemid - 1)
	if count == amount then
		for i = 1, #walls do
			doCreateItem(id,1, walls[i])
		end
	end
	return true
end

function onStepOut(cid, item, frompos, item2, topos)
	doTransformItem(item.uid, item.itemid + 1)
	if count == amount then
		for i = 1, #walls do
			local p = getTileItemById(walls[i], id).uid
			if p ~= 0 then
				doRemoveItem(p)
			end
		end
	end
	count = count -1
	return true
end
 
Here We Are :)

in your movements/scripts create file name siriontest.lua and paste the following:
Lua:
local sirion = {
        wallid = 1049, -- the wall id
        firstsqmuid = 425, -- first sqm Area uniqueid 
        secondsqmuid = 426, -- second sqm Area uniqueid
	wallpos1 = {x=988, y=805, z=14}, -- first wall position
	wallpos2 = {x=989, y=805, z=14} -- second wall position
        }
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) and item.uid == sirion.firstsqmuid and item.uid == sirion.secondsqmuid then
		doRemoveItem(getTileItemById(sirion.wallpos1, sirion.wallid).uid)
		doRemoveItem(getTileItemById(sirion.wallpos2, sirion.wallid).uid)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have removed the wall.')
		doTransformItem(item.uid, sirion.firstsqmuid)
	return true
  end
function onStepOut(cid, item, pos, fromPos)
	if isPlayer(cid) and item.uid == sirion.firstsqmuid and item.uid == sirion.secondsqmuid then
		doCreateItem(wallid, 1, wallpos1)
		doCreateItem(wallid, 1, wallpos2)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wall is back.')
		doTransformItem(item.uid, sirion.secondsqmuid)
	return true
  end

in your movements/movements.xml paste the following:
XML:
	<movevent type="StepIn" uniqueid="425" script="siriontest.lua" />
	<movevent type="StepOut" uniqueid="426" script="siriontest.lua" />

Rep++ If It Helpful For You
 
Last edited:
i had 1 hour making it , so i don't know if it will work or not :) any errors report back
Here We Are :)
in your movements/scripts create file name siriontest.lua and paste the following:
Lua:
        local sirion = {
        wallid = 1049, -- the wall id
        firstsqmuid = 425, -- first sqm Area uniqueid 
        secondsqmuid = 426, -- second sqm Area uniqueid
		wallpos1 = {x=988, y=805, z=14}, -- first wall position
		wallpos2 = {x=989, y=805, z=14} -- second wall position
        }
function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
	if item.uid == sirion.firstsqmuid then
	if item.uid == sirion.secondsqmuid then
	
		doRemoveItem(getTileItemById(sirion.wallpos1, sirion.wallid).uid)
		doRemoveItem(getTileItemById(sirion.wallpos2, sirion.wallid).uid)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have removed the wall.')
		doTransformItem(item.uid, sirion.firstsqmuid)
	end
end
end
end
function onStepOut(cid, item, pos, fromPos)
	if isPlayer(cid) then
	if item.uid == sirion.firstsqmuid then
	if item.uid == sirion.secondsqmuid then
		doCreateItem(wallid, 1, wallpos1)
		doCreateItem(wallid, 1, wallpos2)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wall is back.')
		doTransformItem(item.uid, sirion.secondsqmuid)
		
	end
end
end
end

in your movements/movements.xml paste the following:
XML:
	<movevent type="StepIn" uniqueid="425" script="siriontest.lua" />
	<movevent type="StepOut" uniqueid="426" script="siriontest.lua" />

10% it work :D
Rep++ If It Helpful For You

It doesnt check if there is 2 players which stepping on the tile.
 
i am think
if item.uid == sirion.firstsqmuid then
if item.uid == sirion.secondsqmuid then

when 2 palyers stay in first uid and other player stay in second uid it will make the action :p
 
Code:
local config = {
	players = { Position(x, y, z), Position(x, y, z) },
	walls = { { wallid, Position(x, y, z) }, { wallid, Position(x, y, z) } }
}

function onStepIn(cid, item, pos, fromPos)
	for i = 1, #config.players do
		if(not(isPlayer(getTopCreature(config.players[i]).uid)))then
			return true
		end
	end

	for i = 1, #config.walls do
		local item = getTileItemById(config.walls[i][2], config.walls[i][1])
		if(item.uid > 0)then
			doRemoveItem(item.uid)
		end
	end

	return true
end

function onStepOut(cid, item, pos, fromPos)
	if(not(isPlayer(cid)))then
		return true
	end

	for i = 1, #config.walls do
		doCreateItem(config.walls[i][1], config.walls[i][2])
	end

	return true
end
 
Last edited:
Back
Top