WoW:API UnitSetRole: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Created page with "== Synopsis == Sets the player role in the group as Tank, Dps, Healer or None. UnitSetRole(player,role)")
 
m (Move page script moved page API UnitSetRole to API UnitSetRole without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Stub/API}}
{{wowapi}}
== Synopsis ==
== Synopsis ==
Sets the player role in the group as Tank, Dps, Healer or None.
Sets the player role in the group as Tank, Dps, Healer or None.

Latest revision as of 04:47, 15 August 2023

WoW API < UnitSetRole

Synopsis[edit]

Sets the player role in the group as Tank, Dps, Healer or None.

UnitSetRole(target,role)

Arguments[edit]

target
String - The affected group member. i.e. "player" or player name
role
String - The role for the player. (known values "TANK", "HEALER", "DAMAGER", "NONE")

Returns[edit]

Unknown

Example[edit]

local name="Imtarr";           
if ( playerInfo[name].tank == 1 ) then
   UnitSetRole(name,"TANK");
elseif ( playerInfo[name].heals == 1 ) then
   UnitSetRole(name,"HEALER");
elseif ( playerInfo[name].mDps == 1 ) then
   UnitSetRole(name,"DAMAGER");
elseif ( playerInfo[name].rDps == 1 ) then
   UnitSetRole(name,"DAMAGER");
end

Results[edit]

Sets the player role to the value specified. Note that the command will not allow roles to be assigned to classes that are not considered to be capable of fulfilling that role. i.e. It will not allow a Hunter to be given the role of TANK.

A system message will be sent to the members of the group.

"Healdude is now <<healTexture>> Healer. (Changed by Imtarr.)"