How to check if Unit target is player - WoWInterface
Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-20-18, 09:52 AM   #1
A Murloc Raider
Join Date: Oct 2018
Posts: 5
How to check if Unit target is player


I would like to edit nameplate addon to change colour when unit targets a player. For example there are 4 units attacking a player and 2 of them not. 4 units should have one colour and other different one.

if UnitTarget == Player then
-- player targeted colour stuff
-- player not targetted

How to achieve that?

I was trying with if UnitIsPlayer(UnitName("targettarget")) then

however it works only with unit you target. If you switch a target to some other unit, it works as if player was not targetted, while he is.

WoWInterface » Developer Discussions » Lua/XML Help » How to check if Unit target is player

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off