Garry's Mod Wiki

Garry's Mod Wiki

  boolean Entity:Alive()

Description

Checks if the entity is considered alive.

Checks entity's internal life state variable. Does not check health, but it is generally expected the health to be 0 or below at the point of an entity being considered dead. This internally looks up the save value m_lifeState

Returns

1 boolean
Whether the entity is considered alive.

Example

Sets the entity to return false for :Alive(), useful for npcs/nextbots that don't die at 0 health.

-- 0 is alive, 1 is "death animation", 2 is dead. ent:SetSaveValue("m_lifeState", 2) print(ent:Alive())

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 four times a day. Edits and history are not available.

Last Parsed: Loading...