User Tools

Site Tools


damage_entity

Damage Entity


Deals the specified amount of damage to an entity. The entity is killed/destroyed if its health is reduced to zero.

Signature:

damage_entity(entity, damage_amount)
ArgumentDescriptionTypeRequired
entityEntity that will be damaged.EntityYes
damage_amountAmount of damage to deal.NumberYes

You can use the related Heal Entity function to restore health to an entity that has been previously damaged.

Example:

damage_entity(player, 2);

Results: The player's health is reduced by 2.

Use the Damage Entity function to inflict damage upon characters as they step onto hazardous tiles or open trapped chests.


Editor Node:

Visual Demo:

damage_entity.txt · Last modified: 2021/04/21 18:58 by justin