Just put it before the if guildie line to include the others. But you will then have to move the line starting with local nameplate = to the same place so you can access the nameplate object.
So instead of ..
Lua Code:
if guildie[guid] then
PlaySound(416)
local nameplate = C_NamePlate.GetNamePlateForUnit(unit)
nameplate.UnitFrame.name:SetTextColor(1,1,1,1)
nameplate.UnitFrame.healthBar:Hide()
print(name)
end
It should look like this..
Lua Code:
local nameplate = C_NamePlate.GetNamePlateForUnit(unit)
nameplate.UnitFrame.healthBar:Hide()
if guildie[guid] then
PlaySound(416)
nameplate.UnitFrame.name:SetTextColor(1,1,1,1)
print(name)
end
This essentially hides the healthbar immediately when they first are shown ( but wow may show it again during its update routine ) and then does the guildie check before setting the text color and playing the sound if it is a guildie.