take_damage

Deals damage to the specified player.

ArgumentTypeDescription
damaged_player:realPlayer number of the player to damage
attacking_player:realAttacker's player number. Only used for stat tracking, and should be set to -1 if the damage is not from another player
damage:realThe damage to deal. Negative damage values will heal the player instead

Example, called from attack_update.gml:

// heals 10 damage to self:
if (attack == AT_NSPECIAL) {
if (window == 4 && window_timer > 30 && window_timer < 41) {
take_damage( player, -1, -1 );
}
}