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

Simple script

Glecko

Veteran OT User
Joined
Aug 21, 2007
Messages
1,054
Reaction score
270
Location
Spain
Well, I need a script that if you pull a lever (with some uid) a wall will disapear, and after X time, the wall will apear again.
I know its simple but after making many scripts and testing some other I still can't make the wall apear again :S

Would apreciate some help
(and ofc giving rep++) :p
 
That's not what im looking for
as far as i know that script removes magic walls with intervals to give visual effects.
 
main idea , you add checks etc..

LUA:
local itemm = getThingFromPos({x=,y=,z=,stackpos=1})
deRemoveItem(itemm.uid)
addEvent(doCreateItem, 1 * 1000, wallid, 1, pos)
 
I already tried that with addEvent, still not working for me :/

This is the last one i tried

Code:
function onUse(cid, item, frompos, item2, topos)
pared1 = {x=2390, y=2303, z=5 , stackpos=1}
getpared1 = getThingfromPos(pared1)

if item.itemid == 1945 then
doRemoveItem(getpared1.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 8000 and item.itemid == 1946 then
doCreateItem(9123,1,pared1)
doTransformItem(item.uid,item.itemid-1)

local item2 = doTransformItem(item.uid,1946-1)

addEvent(onTime,5*60,item2) 

end

return 1
end
 
try this
LUA:
local wallpos = {x=1000,y=1000,z= 7, stackpos = 1}
local wallid = 6346   -- wall id
local timee = 3 -- in seconds
function onUse(cid, item, frompos, item2, topos)
  local itemm = getThingFromPos(wallpos)
      if (itemm.uid ~= 0 and itemm.itemid == wallid) then
              doRemoveItem(itemm.uid, 1)
                  addEvent(doCreateItem, timee * 1000, wallid, 1, wallpos)
      end
return item.itemid == 1945 and doTransformItem(item.uid,1946) or doTransformItem(item.uid,1945)
end
 
Last edited:
Code:
local config = {
	wallid = 6346,
	pos = {x=1000,y=1000,z= 7},
	delay = 5
}
local event = 0

function onUse(cid, item, frompos, item2, topos)
	local get = getTileItemById(config.pos, config.wallid).uid
	if get > 0 then
		doRemoveItem(get)
		event = addEvent(doCreateItem, config.delay * 1000, config.wallid, 1, config.pos)
	else
		stopEvent(event)
		doCreateItem(config.wallid, 1, config.pos)
	end
	doTransformItem(item.uid,item.itemid == 1945 and 1946 or 1945)
	return true
end
 
Back
Top