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

TFS 1.X+ No interval in creaturescripts?

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
72
I need to use creaturescripts instead of globalevents because there, we can register events to the creatures we want

Added this function so far
Lua:
function onThink(cid, interval)
   print(interval)
end

and this is what I have in xml file:
XML:
<event type="think" name="printMsg" interval="2000" script="printMsg.lua"/>

It does print the message, but every one second. Even in the console, the interval = 1000 instead of the one specified in creaturescripts.xml, which is 2000

I know interval works just right when it comes to globalevents but not here. Any help appreciated, thanks!
 
Creaturescripts are runninv along creature think interval ticks.
otland/forgottenserver
It does affect many more things than just creaturescripts itself tho.

I guess you can try to tinker with addEvent here.
 
Solution
Creaturescripts are runninv along creature think interval ticks.
otland/forgottenserver
It does affect many more things than just creaturescripts itself tho.

I guess you can try to tinker with addEvent here.

yes, I guess it's possible to just add addEvent and unregister creature on execution then that would work. But in terms of safety, its not as good as onThink I think

Oh well, gonna stay with what I have right now. Apparently, condition damage is based on this as well, so it shouldn't really matter if lets say 50 players are executing a bit of code every second
 
Back
Top