IsAlive

From Nomad DB
Revision as of 18:05, 14 April 2020 by Jan (talk | contribs) (Created page with "Checks if an EntityId is alive. == Syntax == <pre> IsAlive(EntityId) </pre> * '''EntityId''' of the Entity to check * '''Returns: number''' indicating 0 for dead, 1...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Checks if an EntityId is alive.

Syntax

IsAlive(EntityId)
  • EntityId of the Entity to check
  • Returns: number indicating 0 for dead, 1 for alive

Example

This functions checks if the Local Player exists and is alive.

local function IsLocalPlayerValid()
	local plyId = GetLocalPlayerEntityId()
	if plyId == GetInvalidEntityId() then
		return false
	end
	return IsAlive(plyId) == 1
end

Related Pages