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

add time limit

bleeblahblork

New Member
Joined
Aug 12, 2009
Messages
117
Reaction score
0
What should be added to make the gate reappear after 60seconds?

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

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


FIXED.
 
Last edited:
Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=83, y=213, z=9, stackpos=1}
getgate = getThingfromPos(gatepos)

if item.uid == 20004 and item.itemid == 1945 and getgate.itemid == 9596 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 20004 and item.itemid == 1946 and getgate.itemid == 0 then
doCreateItem(9596,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
addEvent(onTimer1, 1*60*1000)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end

return 1
end

function onTimer1()

wallnewpos = {x=83, y=213, z=9} 
		doCreateItem(9596,1,wallnewpos)

end

Try this one, post if any errors, will put a new wall after 1 minute..

Rep if work ;)
 
Oh sorry I failed abit, this one should work.

Code:
function onUse(cid, item, frompos, item2, topos)
gatepos = {x=83, y=213, z=9, stackpos=1}
gatenewpos = {x=83, y=213, z=9 stackpos=1} 
getgate = getThingfromPos(gatepos)

if item.uid == 20004 and item.itemid == 1945 and getgate.itemid == 9596 then
doRemoveItem(getgate.uid,1)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 20004 and item.itemid == 1946 and getgate.itemid == 0 then
doCreateItem(9596,1,gatepos)
doTransformItem(item.uid,item.itemid-1)
addEvent(onTimer1, 1*60*1000)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end

return 1
end

function onTimer1()
		doCreateItem(9596,1,gatenewpos)

end

I hope this one works out!
 
I appreciate your help! I played around with your first script,and got it to work! Without the information you added I would have never gotten it to work.

Thank again!

++rep


Code:
function onTimer1()

wallnewpos = {x=83, y=213, z=9} 
		doCreateItem(9596,1,wallnewpos)

end

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

if item.uid == 20004 and item.itemid == 1945 and getgate.itemid == 9596 then
doRemoveItem(getgate.uid,1)
addEvent(onTimer1, 180*1000)
doTransformItem(item.uid,item.itemid+1)
elseif item.uid == 20004 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"Sorry not possible.")
end

return 1
end
 
Back
Top