||04-24-18 07:26 AM
UnitThreat not working
can anyone tell, why does this code not working? Im trying to get the frame load if the party unit has threat >0
table.insert(self.__elements, function(self, _, unit, event, ...)
local status = UnitThreatSituation(unit)
if (unit == 'party1') or (unit == 'party2') or (unit == 'party3') or (unit == 'party4') then
if status and status >0 then
frame_3texture:SetPoint('CENTER', self, 'CENTER', 22, -2)
frame_3texture:SetTexCoord(1, 0, 0, 1)
But It just does nothing
Could you use the LUA highlight capability of the forum?
Makes the snippets way easier to read.
You have a button in the toolbar.
[ highlight="Lua" ] [ /highlight ]
Hard to debug a piece of code in isolation and you didn't say exactly what is not working.
What I can tell you is that you need to register the Threat Events against a callback in order for you to see any updates.
local function UpdateThreat(self, event, unit)
-- Do stuff here
|All times are GMT -6. The time now is 02:29 PM.
vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI