Originally Posted by Fizzlemizz
Something like:
Code:
local Color = { r=1, g=0, b=0 } -- red for any hostile
if UnitExists("target") then
if not UnitCanAttack("player", "target") then
local _, Class = UnitClass("target")
Color = RAID_CLASS_COLORS[Class] or {r = 1, g = 1, b = 1}
end
self.bg:SetVertexColor(Color.r, Color.g, Color.b, self.bg:GetAlpha())
else
self.bg:Hide() -- or set it to some generic colour
end
|
Thank you, ive tried this and this did not work how i wanted it to work. I got a image here of what happened ingame with this script!
I pasted the script in "onEvent" and kept the same "onLoad" script as my original post, is the mistake there?
http://i.imgur.com/YXpwBBk.jpg
Hope this helps you find the mistake either you or i did :P