1. #1
    Keyboard Turner
    7+ Year Old Account
    Join Date
    Apr 2014
    Location
    SeaTac WA
    Posts
    5

    Simple Lua Script help please

    Hi I'm using Pitbull4 for my unit frames and i'm trying to make a Lua code that makes player names show in their class colors.

    Also could someone edit this code so that it doesn't show Humanoid, Beast, etc after the level on NPC's but keep the class for players at the end of their level.

    Outline()local dr,dg,db = DifficultyColor(unit)
    local classification = Classification(unit)
    if UnitIsPlayer(unit) then
    local cr,cg,cb = ClassColor(unit)
    return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r",dr,dg,db,Level(unit),cr,cg,cb,Class(unit)
    else
    local classification = Classification(unit)
    return "%s%s|cff%02x%02x%02x%s|r %s",classification or '',classification and ' ' or '',dr,dg,db,Level(unit),SmartRace(unit) or ''
    end
    Last edited by Jestin66; 2017-05-24 at 09:41 PM.

  2. #2
    Stood in the Fire Tehr's Avatar
    10+ Year Old Account
    Join Date
    Jul 2010
    Location
    USA
    Posts
    445
    Hey I don't know shit about PitBull so I can't help you with the first part, but this code should work to remove the race of the target NPC:

    Code:
    Outline()
    local dr,dg,db = DifficultyColor(unit)
    local classification = Classification(unit)
    if UnitIsPlayer(unit) then
        local cr,cg,cb = ClassColor(unit)
        return "|cff%02x%02x%02x%s|r |cff%02x%02x%02x%s|r",dr,dg,db,Level(unit),cr,cg,cb,Class(unit)
    else
        local classification = Classification(unit)
        return "%s%s|cff%02x%02x%02x%s|r",classification or '',classification and ' ' or '',dr,dg,db,Level(unit)
    end
    Also I lived near SeaTac for about 15 years! Cheers.
    B.Net: Tehr#1477 | Discord: Tehr#5246 | Stream | Guild Website | List of characters
    Raid CD Tracker (#1 on wago.io): Tehr's RaidCDs, ExternalCDs, UtilityCDs, ImmunityCDs, AoECCs, RezCDs, & Interrupts

  3. #3
    Keyboard Turner
    7+ Year Old Account
    Join Date
    Apr 2014
    Location
    SeaTac WA
    Posts
    5
    Born and raised here myself! That script is working perfectly, Thank you for the help!
    Now i just need the first Lua Script and I can stop wasting so much time on my UI.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •