Thread: oUF_AuraBars
View Single Post
01-19-15, 04:46 PM   #19
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Possible, certainly, but that snippet you posted has a syntax error on almost every line.

1. The proper format is "for ... do" just like "if ... then" -- you are missing the "do" keyword.

2. You have an "if ... else ... end" inside of a "do ... (end)" but you are missing the last "end" keyword.

3. The second and third lines will throw errors about attempting to concatenate nil values. You need to (a) put quotes around the "oUF_TerennaBoss" part to make it a string value and (b) wrap that and the "..i" in a _G[...] lookup to actually get a refererence to the global object.

Code:
for i = 1, 5 do
    if UnitIsUnit('target', 'boss'..i) then
        _G["oUF_TerennaBoss"..i].DebuffBars:Hide()
    else
        _G["oUF_TerennaBoss"..i].DebuffBars:Show()
    end
end
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote