SetUnitOwner

Parameters
whichUnit unit

Unit to modify.

whichPlayer player

The unit's new owner.

changeColor boolean

True to change unit's accent color to new owner's color, false to leave old color.

comment

Changes ownership of a unit.

note

See: GetOwningPlayer, Player.

note

Reforged: The HP bar will always have the color of its owner player, regardless of changeColor.

return type
nothing
Source code
native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing
Source
unit.j
wc3modding.com
SetUnitOwner