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

Switch with time

morramead

New Member
Joined
Jan 23, 2008
Messages
74
Reaction score
0
Hey, i again XD

I need a action with "Switch with time".
Example:
Player use the switch(ID1945) and remove the stone and the switch (1945 transform 1946) Ok...
Later of 1 minute(1minute for example) the switch enabled back to id 1945 and back the stone position(create stone again).

I using the code, but i dont know how add time for the switch,Look:

function onUse(cid, item, frompos, item2, topos)
gatepos = {x=1037, y=1089, z=9, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 1850 and item.itemid == 1945 and getgate.itemid == 1309 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 1850 and item.itemid == 1946
and getgate.itemid == 0 then
doCreateItem(1309,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry, not possible.")
end
return 1
end

gatepos = Cordenate stone
1850 = uniqueid switch
1945 = switch ( not enabled )
1946 = switch ( enabled )

How i add time for the switch?

Thank all, i wait for a comment...
 
Last edited:
I kinda dont uderstand you, but you can use addEvent().

addEvent(doTransformItem(item.uid, item.itemid + 1), 1 * 60 * 1000, a) - wrong

@
Code:
function transform(item)
    doTransformItem(item.uid, itemid + 1)
end
Code:
addEvent(transform, 1 * 60 * 1000, a)

Try.
 
Last edited:
Back
Top