Hi,
Try this - which is modified code from the forum post you linked.
In your onload script:
Lua Code:
self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PLAYER_TARGET_CHANGED")
self:Hide()
In your onevent script:
Lua Code:
local FFA_PVP_TEXTURE = "Interface\\TargetingFrame\\UI-PVP-FFA" -- The paths to the textures to be used when the player is flagged for FFA/regular PvP.
local REG_PVP_TEXTURE = "Interface\\TargetingFrame\\UI-PVP-%f" -- %f in both paths will be replaced with either Horde or Alliance, depending on the player's faction.
self:Hide()
local faction = UnitFactionGroup("target")
if UnitIsPVPFreeForAll("target") then
self.bg:SetTexture(FFA_PVP_TEXTURE)
self:Show()
elseif UnitIsPVP("target") then
self.bg:SetTexture(REG_PVP_TEXTURE:gsub("%%f", faction))
self:Show
end
Ekat