Hello Guys, I am trying to create a custom weak aura. The idea is, that I will be able to track when enemy npcs have the Unworthy debuff on them which I apply but hitting judgement on them. I would like the judgement Icon to be highlighted above enemy health NPC when the unworthy debuff is active on them. I asked ChatGPT for help, it gave me a few different codes and none of them seem to work. The last one being :
-- WeakAura for highlighting Judgment icon when Unworthy buff is active
function(event, ...)
local unworthyBuffId = 123456 -- Replace with the actual spell ID of Unworthy
local unit = "target"
local iconSize = 36 -- Adjust the size of the icon as needed
-- Check if the target has the Unworthy buff
local _, _, _, _, _, _, expirationTime, _, _, _, spellId = UnitBuff(unit, GetSpellInfo(unworthyBuffId))
if spellId == unworthyBuffId and expirationTime then
-- Calculate remaining time on the Unworthy buff
local remainingTime = expirationTime - GetTime()
-- Display a basic text on top of the target's health bar
local text = string.format("Unworthy: %.1fs", remainingTime)
return true, text
else
return false
end
end
I did replace the numbers with the unworthy spell ID which I got from "idTip" addon. No matter the version of the code it provided to me, I am getting an error :
Does any of you know why this might be happening? Thank you!