Jump to content

Performance: WornHasKeyword vs OnItemEquipped Cache


henkspamadres

Recommended Posts

A quick question regarding best practice/performance.

 

Say I have a script that when aiming needs to know whether a player has a weapon with a certain keyword equipped.

The obvious way is to call Player.WornHasKeyword(<KEYWORD>)

The alternative would be to register a remove event for the OnItemEquipped and OnItemUnequipped events, check for the keyword there and safe the result in a variable.

 

Is any of the two better or more desired, specifically if I want the script to be as fast as possible when processing the "aim" event?

Any insight would be much appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...