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

[request] remove stones

Aardappel

Learning LUA
Joined
Dec 24, 2007
Messages
145
Reaction score
0
Hi guyss i searched very long but without any results;<

I need a script if i use the lever the stone will dissapear





Greetz,,


Aardappel
 
Here...

Code:
local gatepos = {[COLOR="Red"]x=2446, y=2854, z=15[/COLOR], stackpos=1} 
local newstone = 0
function onUse(cid, item, frompos, item2, topos) 
	local getgate = getThingfromPos(gatepos) 
	if(item.uid == [COLOR="Lime"]10200[/COLOR]) then
		if(item.itemid == 1945 and getgate.itemid == [COLOR="DarkOrange"]1355[/COLOR]) then 
			doRemoveItem(getgate.uid, 1) 
			doTransformItem(item.uid, 1946)
			newstone = addEvent(recreateStone, 1000*[COLOR="RoyalBlue"]30[/COLOR], {pos = gatepos, item = item})
		elseif(item.itemid == 1946 and getgate.itemid == 0) then 
			doCreateItem([COLOR="DarkOrange"]1355[/COLOR],1,gatepos) 
			doTransformItem(item.uid, 1945)
			stopEvent(newstone)
		end
	else 
		doPlayerSendCancel(cid,"Sorry, not possible.") 
	end
	return TRUE
end 
function recreateStone(param)
	doCreateItem([COLOR="DarkOrange"]1355[/COLOR], 1, param.pos)
	doTransformItem(param.item.uid, 1945)
	newstone = 0
end

Red: Coordinates of the stone.
Green: UniqueID in the switch (id 1945).
Orange: The ItemID of the stone.
Blue: Time for the lever reset (1 = 1sec).

^_^
 
Back
Top