scmJS docs

Set Invincibility

Makes the player's units of the type in the location invincible, or takes it away.

Action 43 · Set Invincibility(Player, Unit, Location, State);

Argument Takes Stored in the action
Player a player or group bytes 16–19
Unit a unit type, or one of the unit classes bytes 24–25
Location a location (Anywhere is location 64) bytes 0–3
State enable, disable or toggle byte 27
Set Invincibility("Player 8", "Buildings", "Anywhere", enable);