View Single Post
12-02-12, 07:21 PM   #4
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
This will call your function whenever the player target changes..
Lua Code:
  1. frame:SetScript('OnEvent', function()
  2.     if UnitIsPlayer("target") then
  3.         frametext:SetText(UnitName("target"))
  4.         classtext:SetText(UnitClass("target") .. " " .. UnitRace("target"))
  5.         healthtext:SetText(UnitHealthMax("target") .. " Max HP")
  6.         partybutton()
  7.     end
  8. end)
  9. frame:RegisterEvent('PLAYER_TARGET_CHANGED')
  Reply With Quote