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

Pause in LUA script

Maten

New Member
Joined
Mar 16, 2009
Messages
219
Reaction score
2
Hey all!

Im trying to learn some lua script and I wonder if someone could tell me how I can make a pause for maybe 300 millisecond


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 2348 then
		doSendMagicEffect(getPlayerPosition(cid),49)

                 V Want pause between these lines ^

		doSendMagicEffect(getPlayerPosition(cid),42)
		doCreatureSay(cid, "Hey it worked", TALKTYPE_ORANGE_1)
    end
    return TRUE 
end
 
You have to work with addEvent()

Lua:
local function delayedEvent(cid)
  if not isPlayer(cid) then return true end

  doSendMagicEffect(getPlayerPosition(cid),42)
  doCreatureSay(cid, "Hey it worked", TALKTYPE_ORANGE_1)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == 2348 then
		doSendMagicEffect(getPlayerPosition(cid),49)

                addEvent(delayedEvent, 2000, cid)
    end
    return TRUE 
end
 

Similar threads

Back
Top