Entity

Physical object in the game world.

Entities are physical representations of objects in the game world. Helix extends the functionality of entities to interface between Helix's own classes, and to reduce boilerplate code.

See the Garry's Mod Wiki for all other methods that the Player class has.

Functions

Entity:BlastDoor(velocity, lifeTime, bIgnorePartner)

View source »

Blasts a door off its hinges. Internally, this hides the door entity, spawns a physics prop with the same model, and applies force to the prop.

Parameters

  • velocity vector

    Velocity to apply to the door

  • lifeTime number

    How long to wait in seconds before the door is put back on its hinges

  • bIgnorePartner boolean

    Whether or not to ignore the door's partner in the case of double doors

Returns

  • nil

    If the entity is not a door

  • OR
  • Entity

    The physics prop created for the door

Entity:ClearNetVars(receiver)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Clears all of the networked variables.

Parameters

  • receiver table default: nil

    The players to clear the networked variable for

Entity:GetBlocker()

View source »

Returns the entity that is blocking this door from opening.

Returns

  • Entity

    Entity that is blocking this door

  • OR
  • nil

    If this entity is not a door, or there is no blocking entity

Entity:GetDoorPartner()

View source »

Returns the neighbouring door entity for double doors.

Returns

  • Entity

    This door's partner

  • OR
  • nil

    If the door does not have a partner

Entity:GetNetVar(key, default)

View source »

Retrieves a networked variable. If it is not set, it'll return the default that you've specified.

Parameters

  • key string

    Identifier of the networked variable

  • default

    Default value to return if the networked variable is not set

Returns

  • any

    Value associated with the key, or the default that was given if it doesn't exist

Example Usage

print(client:GetNetVar("example"))
 > Hello World!

See Also

Entity:IsChair()

View source »

Returns true if this entity is a chair.

Returns

  • bool

    Whether or not this entity is a chair

Entity:IsDoor()

View source »

Returns true if this entity is a door. Internally, this checks to see if the entity's class has door in its name.

Returns

  • bool

    Whether or not the entity is a door

Entity:IsLocked()

View source »

Returns true if the given entity is a button or door and is locked.

Returns

  • bool

    Whether or not this entity is locked; false if this entity cannot be locked at all (e.g not a button or door)

Entity:SendNetVar(key, receiver)

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

View source »

Sends a networked variable.

Parameters

  • key string

    Identifier of the networked variable

  • receiver table default: nil

    The players to send the networked variable to

Entity:SetNetVar(key, value, receiver)

View source »

Sets the value of a networked variable.

Parameters

  • key string

    Identifier of the networked variable

  • value

    New value to assign to the networked variable

  • receiver table default: nil

    The players to send the networked variable to

Example Usage

client:SetNetVar("example", "Hello World!")

See Also