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

How to remove two walls for a few minutes?

I need a script that removes some walls for a few minutes when you drawn in the lever, and after a few mintter then the walls came back. When drawn in the lever it will came text up on the screen.
 
Like this script, but i need the walls to came back after few minutes.

local config = {
lever_uid = 7002,
walls = {
[1] = {id = 1052, pos = {x=1496, y=1488, z=5}, relocate = {x=1496, y=1489, z=5}},
[2] = {id = 1052, pos = {x=1497, y=1488, z=5}, relocate = {x=1497, y=1489, z=5}}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 7002 then
if item.itemid == 1945 then
for i = 1, #config.walls do
local getWall = getTileItemById(config.walls.pos, config.walls.id).uid
if getWall > 0 then
doRemoveItem(getWall)
end
end
doTransformItem(item.uid, item.itemid+1)
return TRUE
elseif item.itemid == 1946 then
for i = 1, #config.walls do
local getWall = getTileItemById(config.walls.pos, config.walls.id).uid
if getWall == 0 then
doRelocate(config.walls.pos, config.walls.relocate)
doCreateItem(config.walls.id, 1, config.walls.pos)
end
end
doTransformItem(item.uid,item.itemid-1)
return TRUE
end
end
return FALSE
end


or this script

function onUse(cid, item, frompos, item2, topos)
wall1 = {x=1496, y=1488, z=5, stackpos=1}
wall2 = {x=1497, y=1488, z=5, stackpos=1}
getwall1 = getThingfromPos(wall1)
getwall2 = getThingfromPos(wall2)

if item.uid == 7002 and item.itemid == 1945 then
doRemoveItem(getwall1.uid,1)
doRemoveItem(getwall2.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 7002 and item.itemid == 1946 then
doCreateItem(1052,1,wall1)
doCreateItem(1052,1,wall2)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end

return 1
end
 
Here I modified the second script:
PHP:
function onUse(cid, item, frompos, item2, topos)
	local wall1, wall2 = {x=1496, y=1488, z=5, stackpos=1}, {x=1497, y=1488, z=5, stackpos=1}
	local getwall1, getwall2 = getThingfromPos(wall1),getThingfromPos(wall2)
	local timeToComeBack = 120 -- in seconds

	if item.uid == 7002 and isInArray({1945,1946},item.itemid) then
		doRemoveItem(getwall1.uid,1)
		doRemoveItem(getwall2.uid,1)
		addEvent(doCreateItem,timeToComeBack*1000,1052,1,wall2)
		addEvent(doCreateItem,timeToComeBack*1000,1052,1,wall1)
		doTransformItem(item.uid,(item.itemid == 1945 and 1946 or 1945))
	else
		doPlayerSendCancel(cid,"Sorry, not possible.")
	end

return true
end
 
Do you know how to get text to came up on screen when one reinforces the lever + that you have done with the script?
If you know it, can you please make that script to me? Plzzzzz ;-)
 
Back
Top