• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

AddEvent or Onthink?

infrator123

Member
Joined
Aug 10, 2011
Messages
27
Reaction score
7
Im thinking about using a for to check every slot item on player, what has a better performance? using onthink of creaturescripts or addEvent? and theres not a problem doing that, right?
 
Im thinking about using a for to check every slot item on player, what has a better performance? using onthink of creaturescripts or addEvent? and theres not a problem doing that, right?
depends on what your doing on how big your addEvent function is

I personally like Recursion with functions / addEvents

Code:
function test ()

  if (player and itemnotfound)

  addEvent(test, 50)

  else
    dothis()
  end

end

no problem with this as long as you dont allow leaks and good error checks..
make sure you test good because bad recursion can allow memory problems over time.
 
Back
Top