Health
Gives any entity health, an optional shield, regeneration, invulnerability frames, armor, death and a respawn / reset / remove rule. Attach it to a player body, enemy or prop; no sibling components are required. On a CharacterController body it disables movement while dead. Only…
Health
Gives any entity health, an optional shield, regeneration, invulnerability frames, armor, death and a respawn / reset / remove rule. Attach it to a player body, enemy or prop; no sibling components are required. On a CharacterController body it disables movement while dead. Only the owning peer changes it; use Lifeline.damage/heal/kill/revive or the damage/heal methods. Fires typed events damaged, healed, blocked, died, respawned. See the package README for fields.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Health — gives any entity health, an optional shield, regeneration, invulnerability frames, death and a respawn / reset / remove rule. Put it on a player body, an enemy, a crate — anything that can get hurt. Deal damage through the Lifeline API (or this component's methods): local Lifeline = require("Lifeline.api") Lifeline.damage(target, 20, { kind = "fire", source = attacker }) Only the peer that OWNS the entity changes its health. Everyone else sees the synced fields and receives the events.
payloadSchema( ) → void
now( ) → number
authority( ) → boolean
isPlayer( ) → boolean
deathMode( ) → string
headPos( ) → void
publish(evt: string, amount: number, shieldAmount: number, info: any, reason: string?) → void
| arg | type | description |
|---|---|---|
| evt | string | |
| amount | number | |
| shieldAmount | number | |
| info | any | |
| reason | string? |
collectModels( ) → void
setFlash(blend: number) → void
| arg | type | description |
|---|---|---|
| blend | number |
startFlash(r: number, g: number, b: number, dur: number) → void
| arg | type | description |
|---|---|---|
| r | number | |
| g | number | |
| b | number | |
| dur | number |
setControllerEnabled(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
fallOver( ) → void
die(info: any) → void
| arg | type | description |
|---|---|---|
| info | any |
doRespawn(mode: string) → void
| arg | type | description |
|---|---|---|
| mode | string |
applyChange(op: string, amount: number, info: any, from: number?) → void
Apply a health change. Lifeline.api calls this on the OWNING peer only; use Lifeline.damage / heal / kill / revive (or this component's damage/heal methods) rather than calling it yourself.
| arg | type | description |
|---|---|---|
| op | string | |
| amount | number | |
| info | any | |
| from | number? |
fireLocalEvent(evt: string, payload: any) → void
Run by Lifeline on every peer when an event about this entity arrives.
| arg | type | description |
|---|---|---|
| evt | string | |
| payload | any |
damage(amount: number, info: any?) → void
Deal damage to this entity. info: { kind, source, crit, origin, dot }.
| arg | type | description |
|---|---|---|
| amount | number | |
| info | any? |
heal(amount: number, info: any?) → void
Heal this entity.
| arg | type | description |
|---|---|---|
| amount | number | |
| info | any? |
kill(info: any?) → void
Kill this entity outright.
| arg | type | description |
|---|---|---|
| info | any? |
revive( ) → void
Bring this entity back now.
fraction( ) → number
Health as a 0..1 fraction.
respawnRemaining( ) → number
Seconds until this (dead) entity respawns or resets, on the owning peer; 0 otherwise.
isPlayer( ) → boolean
Is this entity a player avatar?
invulnerableFor( ) → number
Seconds of invulnerability left (owner only).
push(vx: number, vz: number) → void
Shove the entity sideways (owner only), e.g. knockback. Metres per second.
| arg | type | description |
|---|---|---|
| vx | number | |
| vz | number |
awake( ) → void
onDestroy( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.