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

Delay

Dixtro

New Member
Joined
May 4, 2010
Messages
49
Reaction score
3
Location
Poland!
Hello.
Someone know how add item delay before used it?
like in Yalahari quest when used globus need wait sometime.
I will be greatful:$
 
why in yalahari that was diffrent ?
Code:
function Glllobe()
item1 = getTileItemById(glo,9767)
doSetItemActionId(item1.uid, 58261)
end
if item.actionid == 58261 then
doSetItemActionId(item.uid, 58263)
addEvent(Glllobe, 900000)
elseif item.actionid == 58263 then
doCreatureSay(cid, "You have to wait some time before this globe will charge.", TALKTYPE_ORANGE_1)
end
 
addEvent(callback, delay, ...)
In this case callback is functionname and dealy is time. ... means there could be infinite ammount of things in this addevent function :) addEvent could be used for many purposes.
Search for more information.
 
Example
Lua:
function onUse(cid, item, frompos, item2, topos)

piece1pos = {x=32876, y=32583, z=10, stackpos=1}
getpiece1 = getThingfromPos(piece1pos)
if getpiece1.itemid == 1946 then
 doRemoveItem(getpiece1.uid,1)
 doSendMagicEffect(piece1pos,23)
 addEvent(wait1,1000,piece1pos)
end
return 1
end

function wait1(piece1pos)

 doCreateItem(1946,1,piece1pos)

end
Rep+
 
yep,
Code:
doItemSetAttribute(doCreateItem(1946,1,piece1pos), 'uid', [B][COLOR="red"]put the number here[/COLOR][/B])
 
Last edited:
Code:
doItemSetAttribute(doCreateItem(1946,1,piece1pos), 'uid'[COLOR="red"][B][SIZE="3"],[/SIZE][/B][/COLOR] put the number here)
okey that work thanks:***XDDD
 
Back
Top