Garry's Mod Wiki

Garry's Mod Wiki

Description

Information about the ENT structure, which represents a Scripted Entity class definition.

To learn more about scripted entities, see this page.

See also ENTITY Hooks for a list of events scripted entities can have. See Custom Entity Fields for a list of events and fields all entities can have.

While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.

Values defined in ENT table can't be changed per instance. Initialize default values in ENTITY:Initialize or other hook.

Members

string Base
The base entity to derive from. This must be a valid Lua entity
string Type
Type of the entity. This must be one of these:
  • anim
  • brush
  • point
  • ai
  • nextbot
  • filter

See Scripted Entities for a more detailed explanation of what each one is.

string ClassName
The class name of the entity (File or folder name of your entity). This is set automatically after the entity file is loaded.
string ClassNameOverride
If set, overrides the classname of the SWEP.
string Folder
The folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your entity is stored as a file, or multiple files in a folder. This is set automatically before the entity file is loaded.
boolean AutomaticFrameAdvance
Set this to true if your entity has animations. You should also apply changes to the ENTITY:Think function from the example on that page.

Default: false

string Category
Spawnmenu category to put the entity into

Default: "Other"

boolean Spawnable
Whether this entity should be displayed and is spawnable in the spawn menu

Default: false

boolean Editable
Whether the entity supports Editing. See Editable Entities for more info.

Default: false

boolean AdminOnly
Whether or not only admins can spawn the entity from their spawn menu

Default: false

string PrintName
Nice name of the entity to appear in the spawn menu

Default: ""

string Author
The author of the entity

Default: ""

string Contact
The contacts of the entity creator

Default: ""

string Purpose
The purpose of the entity creation

Default: ""

string Instructions
How to use your entity

Default: ""

number RenderGroup
The entity's render group, see RENDERGROUP enum. If unset, the engine will decide the render group based on the entity's model.
boolean WantsTranslucency
If set and RenderGroup is not, will switch the render group to RENDERGROUP_BOTH when appropriate.

Default: false

boolean DisableDuplicator
Disable the ability for players to duplicate this entity.

Default: false

string ScriptedEntityType
Sets the spawnmenu content icon type for the entity, used by spawnmenu in the Sandbox-derived gamemodes. See spawnmenu.AddContentType for more information.

Default: ""

boolean DoNotDuplicate
If set, the entity will not be duplicated via the built-in duplicator system.

Default: false

string IconOverride
If set, overrides the icon path to be displayed in the Spawnmenu for this entity.

Like many functions, this expects a path relative to the materials/ folder, do not include materials/ in the provided string.

Default: "entities/<ClassName>.png"

boolean PhysgunDisabled
If set, the entity forbid physgun interaction.

Default: false

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...