Thread Tools Display Modes
06-21-13, 12:22 PM   #1
rog85
A Kobold Labourer
Join Date: Sep 2009
Posts: 1
Custom Pitbull code help

I have a code, given by another player on the wow forum. This code makes my target frame only show when my target is hostile, or rather, hides my target frame when my target is friendly.

Code:
local f=CreateFrame("Frame")
f:SetScript("OnEvent",function()
  local hide = UnitIsPlayer("target") or (UnitExists("target") and UnitReaction("player","target")>3)
  PitBull4_Frames_target:SetAlpha(hide and 0 or 1)
end)
f:RegisterEvent("PLAYER_TARGET_CHANGED")
It's functioning correctly except for one thing. The first friendly target that I target when I log in, will not hide the target frame. After that, it works. Then, if I don't have a target for 3 seconds or so, and I target somebody friendly, the target frame appears.

Now I don't know if experts can look at codes and know exactly what they do, but I hope someone who is bored and have time on their hand, or want to take on the challenge, help me with these.

I want it so my first initial target won't show the frame and complete fix the 3 second issue.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Custom Pitbull code help


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