Garry's Mod Wiki

duplicator.RegisterEntityModifier

duplicator.RegisterEntityModifier( string name, function func )

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 duplicator.StoreEntityModifier.

This function does nothing when run clientside.

Arguments

1 string name
An identifier for your modification. This is not limited, so be verbose. "Person's 'Unbreakable' mod" is far less likely to cause conflicts than "unbreakable"
2 function func
The function to be called for your modification. It should have the arguments (Player, Entity, Data), where data is what you pass to duplicator.StoreEntityModifier.

Page Links


Special Pages


Wikis

?

Render Time: 81ms

DB GetPage 43
Generate Html 3
SaveChanges (1) 13
Render Body 0
Render Sidebar 19