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

addEvent interval ignored

milbradt

New Member
Joined
Dec 25, 2011
Messages
177
Solutions
1
Reaction score
4
Code:
for i = 100, 500, 100 do
          addEvent(doCreatureSay(cid, "hello",19), i)
end

And it addevent 0.5 (500) every second.

where can I change the time addEvent?


creaturescript onThink has to change in:
creature.h
#define EVENT_CREATURE_THINK_INTERVAL 500
however I do not know which changes the time addEvent... :S
 
First of all it will never work, as you are executing the function and not passing it as a parameter. Try that:

Code:
addEvent(doCreatureSay, i, cid, "hello",19)
 
Up!

I tried to use it, but do not count the time.
Code:
function addEvent(func, time, ...)

local clock = os.clock
local time = time/1000 + clock()

while true do
if time - clock() <= 0 then
func(...)
break
end
end

end

an error in the function?
 
Back
Top