lua check if target is player menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Thomja's Avatar Almost Legendary User
    Reputation
    538
    Join Date
    Nov 2008
    Posts
    638
    Thanks G/R
    14/38
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    lua check if target is player

    Hey

    I wanna add a custom trigger to my WeakAuras icon. Now my lua knowledge is not the best and I want my icon to show when I have the buff Death Note on as a monk(Death Note allows you to use Touch of Death).

    I do not however want it to show when I am fighting regular mobs so the aura trigger wont really work here.

    the code should say something along the lines of

    if target = player and I have Death Note then
    show icon.

    Thanks!
    I really don't have anything interesting to put here anymore.

    lua check if target is player
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Thomja's Avatar Almost Legendary User
    Reputation
    538
    Join Date
    Nov 2008
    Posts
    638
    Thanks G/R
    14/38
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    Thanks a bunch!!! I googled abit but didn't find this.
    I really don't have anything interesting to put here anymore.

  4. #4
    Thomja's Avatar Almost Legendary User
    Reputation
    538
    Join Date
    Nov 2008
    Posts
    638
    Thanks G/R
    14/38
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    It now appears that this is incorrect. This only checks if I am a player right?

    I found this but it's protected though

    API TargetUnit - WoWWiki - Your guide to the World of Warcraft
    I really don't have anything interesting to put here anymore.

  5. #5
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should work:

    Code:
    If you want to check if you are targeting yourself:
    (UnitIsUnit("player","target"))
    
    If you want to check if your target is targeting you:
    (UnitIsUnit("player","targettarget"))
    Last edited by Ultraviolence; 01-14-2014 at 08:40 AM. Reason: fixup

  6. #6
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by thomja View Post
    It now appears that this is incorrect. This only checks if I am a player right?
    No. I checks if unitid you pass as argument is a player (any player) or not.

  7. #7
    Thomja's Avatar Almost Legendary User
    Reputation
    538
    Join Date
    Nov 2008
    Posts
    638
    Thanks G/R
    14/38
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the late response, thanks for the help though!
    I really don't have anything interesting to put here anymore.

Similar Threads

  1. [Question] AoE ground target on player
    By gainz in forum PE Support forum
    Replies: 4
    Last Post: 12-19-2014, 02:05 PM
  2. LUA check Battleground status
    By Iaccidentallytwink in forum WoW UI, Macros and Talent Specs
    Replies: 7
    Last Post: 09-18-2012, 04:24 AM
  3. [How-To] Get your lua script to target the npc you want, with examples
    By choweyiii in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 08-27-2010, 08:22 AM
  4. [C++ creature script] How to target random players?
    By uberhak3r in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 12-11-2009, 08:43 PM
  5. [LUA] Check a Spawned unit's HP? Is it possible?
    By controlsx2 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 05-20-2009, 09:57 AM
All times are GMT -5. The time now is 05:45 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search