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

Lever script

eXact

New Member
Joined
Apr 4, 2012
Messages
14
Reaction score
0
Hi Otland,

i need a script that when use lever on xyz then mwall dissapere on xyz and when walke ocer title xyz then the mwall popup again.

it is possible to do that?

Greetz eXact
 
actions.xml (add the unique id in the lever)
XML:
<action uniqueid="8000" event="script" value="quests/magicwalllever.lua"/>

magicwalllever.lua
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local item = 1498 -- magicwall id
local pos = {x=1000,y=1000,z=7} -- magicwall position

	if getTileItemById(pos, item).uid > 0 then
		doRemoveItem(getTileItemById(pos,item).uid,1)
		doPlayerSendTextMessage(cid, 25, "The magicwall is gone.")
	else
		doPlayerSendCancel(cid, "The magicwall is already gone.")
		return true
	end
end

movements.xml (add the unique id in the ground/tile)
XML:
<movevent type="StepIn" uniqueid="8001" event="script" value="magicwallback.lua"/>

magicwallback.lua
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

local item = 1498 -- magicwall id
local pos = {x=1000,y=1000,z=7} -- magicwall position

	if getTileItemById(pos, item).uid < 1 then
		doCreateItem(item,1,pos)
	end
end
 
Last edited:
Back
Top