Entity
Base class for entities.
Entities are all interactible objects on the server. Learn more here
Networking Methods
Entity:sendNetVar (key, receiver)
Entity:sendNetVar
Sends a network variable from an entity to a specific receiver.
Parameters:
string key Name of the variableClient receiver Client or list of clients to receive the data
Entity:clearNetVars (receiver)
Entity:clearNetVars
Clears all network variables associated with this entity. Notifies the client(s) to remove them.
Parameters:
Client receiver Client or list of clients to receive deletion infoEntity:setNetVar (key, value, receiver)
Entity:setNetVar
Sets a network variable on the entity and notifies the receiver.
Parameters:
string key Variable namevararg value Variable value
Client
receiver
optional
Client or list of clients to receive update
Entity:getNetVar (key, default)
Entity:getNetVar
Retrieves a networked variable from the entity. The clientside version of the function can only return data that was previously networked to the client. Returns a default value if the variable is not set.
Parameters:
string key The variable namevararg
default
optional
A fallback value to return if the key is not present
Returns:
vararg The stored value or the defaultEntity Door Utilities
Provides utility methods for door detection and logic.
Entity:isDoor ()
Entity:isDoor
Checks if an entity is a door by comparing its class.
Returns:
bool True if the entity is a doorEntity:getDoorPartner ()
Entity:getDoorPartner
Returns the door's partner entity (slave or parent).
Returns:
entity The partner door entity if foundOr
nil If the door has no partnerEntity:isLocked ()
Entity:isLocked
Checks if the door or vehicle is locked. Reads from the entity's internal save table.
Returns:
boolTrue
if the entity is locked, false
otherwise
Or
nil If no lock data is availableEntity:getBlocker ()
Entity:getBlocker
Returns the entity that is blocking the door's sequence. Typically another entity preventing the door from moving.
Returns:
entity Blocker entity if presentOr
nil If no blocker is presentEntity:blastDoor (velocity, lifeTime, ignorePartner)
Entity:blastDoor
Simulates the door being blasted open by replacing it with a physics dummy. The original door is hidden and later restored. Optionally applies to a partner door.
Parameters:
Vector velocityoptional
Velocity applied to the dummy object
number
lifeTime
optional. default
: 120
Duration in seconds before restoring the door
boolean
ignorePartner
optional. default
: false
If true, skips blasting the partner door
Returns:
entity The created dummy physics entity replacing the doorEntity Chair Utilities
Provides helper functions to determine whether an entity is considered a chair.