Garry's Mod Wiki

Revision Difference

duplicator.RegisterEntityModifier#515444

<function name="RegisterEntityModifier" parent="duplicator" type="libraryfunc">⤶ <description>⤶ This allows you to register tweaks to entities. For instance, if you were making an "unbreakable" addon, you would use this to enable saving the "unbreakable" state of entities between duplications.⤶ ⤶ This function registers a piece of generic code that is run on all entities with this modifier. In order to have it actually run, use <page>duplicator.StoreEntityModifier</page>.⤶ ⤶ This function does nothing when run clientside.⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="name" type="string">An identifier for your modification. This is not limited, so be verbose. &quot;Person&#x27;s &#x27;Unbreakable&#x27; mod&quot; is far less likely to cause conflicts than &quot;unbreakable&quot;</arg>⤶ <arg name="func" type="function">The function to be called for your modification. It should have the arguments (Player, Entity, Data), where data is what you pass to &lt;page&gt;duplicator.StoreEntityModifier&lt;/page&gt;.</arg>⤶ </args>⤶ </function>⤶ ⤶