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

Lua movement "decay to"?

Status
Not open for further replies.

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,775
Solutions
25
Reaction score
483
Location
Sweden
Is there any function in the movements that decay items to items? ~

Example when you pull a lever(id 1945), it turns to (id 1946) and after let's say 40 seconds, it turns back~

Lua:
function onUse(cid, item, item2)

if item.uid == 1337 and item.itemid == 1945 then
doTransformItem(uid, item.itemid+1)
doChangeBackAfter(40 seconds)~

Thanks in advance
 
Last edited:
Well my post was a bit confusing, I need it to change back levers after an amount of time ~ pitfalls and trapdoors are ofcourse configurable in items.xml :p
 
Code:
function onStepIn(cid, item2, pos)

if item2.itemid == 293 then
doTransformItem(item2.uid,294)
doDecayItem(item2.uid)
end
return 1
end
 
Try this:
Code:
function doChangeBack(parameters)
	local thing = getTileItemById(parameters.pos, 1945)
	local newItem = doTransformItem(thing.uid, parameters.oldType)
end
function onUse(cid, item, item2, topos)
 
if item.uid == 1337 and item.itemid == 1945 then
doTransformItem(uid, item.itemid+1)
addEvent(doChangeBack, 4000, {oldType = item.itemid, pos = topos})
end
return 1
end
 
Status
Not open for further replies.
Back
Top