WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Target of Target's name? (https://www.wowinterface.com/forums/showthread.php?t=57753)

BryanM42 12-28-19 07:11 PM

Target of Target's name?
 
Currently, I have the following snippet of code that works perfectly and tells me what I want to know:

if UnitExists("target") and (UnitIsUnit("targettarget", "player") or UnitIsUnit("targettarget", "pet")) then

I'd like to add functionality that would also return true if the target of my target is a specific name (for example, "Vim Brineheart"). Is that a possibility? I tried using UnitName, but I must have messed up the code somewhere because it broke the originally working bit. Here's what I tried though:

if UnitExists("target") and (UnitIsUnit("targettarget", "player") or UnitIsUnit("targettarget", "pet") or UnitIsUnit(UnitName("targettarget", "Vim Brineheart"))) then

Kanegasi 12-28-19 09:26 PM

You only feed units into those functions. UnitName returns the name.

if UnitName("targettarget") == "Vim Brineheart" then

BryanM42 12-29-19 12:34 AM

Quote:

Originally Posted by Kanegasi (Post 334859)
You only feed units into those functions. UnitName returns the name.

if UnitName("targettarget") == "Vim Brineheart" then

ahhhh ... okay. That makes sense. Thank you!


All times are GMT -6. The time now is 08:02 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI