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

Need script. a switch to add/remove item. forgotten server [7.6]

tompan

Member
Joined
Dec 13, 2008
Messages
646
Reaction score
24
Location
Sweden
i have been looking for a script whole day now. and every one just dont seems to work with my server, i get debug with comunication problems with some scripts and some just keep put errors in my engine.
function onUse(cid, item, frompos, item2, topos)
I want the lever to ADD dwarbridge id (1284) at -- X: 748 Y: 1043 Z: 7 --

and if possible to be removed after X seconds.

Thanks.
 
Last edited:
Well, pretty much the other threads script i saw some minutes ago, i think
LUA:
local seconds = 5
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1945 then
   doCreateItem(1284,1,{x=748,y=1043,z=7})
   event = addEvent(doRemoveItem, 1000*seconds, getThingfromPos({x=748,y=1043,z=7,stackpos=1}).uid, 1)
else
    stopEvent(event)
    doRemoveItem(getThingfromPos({x=748,y=1043,z=7,stackpos=1}).uid,1)
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945), true
end
 
LUA:
local f, e = function()
	doRemoveItem(getThingfromPos({x=748, y=1043, z=7, stackpos=0}).uid)
end, 0

function onUse(cid, item, frompos, item2, topos)
	if item.itemid == 1945 then
		doCreateItem(1284, 1, {x=748, y=1043, z=7})
		e = addEvent(f, 5000)
	else
		stopEvent(e)
		f()
	end
	return TRUE, doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Back
Top