Thank you so much! Worked perfectly. Still it would have been nice to know the RGB 0-1 number for Monks but that shouldn't be a problem anymore. ty again.
---------- Post added 2012-09-26 at 03:10 PM ----------
I have another problem. I want the script to run OnUpdate and it works. When I select a class, the class colour shows but then when I leave my target frame (which is what I want the class colour to apply for), I get this error:
Message: [string "bgtar_OnUpdate"]:13: attempt to index local 'classcolor' (a nil value)
What should I do?
---------- Post added 2012-09-26 at 03:25 PM ----------
It works for some of the frames but not for OnUpdate. Can I just use my normal code:
Code:
local _, class = UnitClass("player");
if class == "WARRIOR" then
self.text:SetTextColor(0.78, 0.61, 0.43)
elseif class == "PRIEST" then
self.text:SetTextColor(1.00, 1.00, 1.00)
elseif class == "MAGE" then
self.text:SetTextColor(0.41, 0.80, 0.94)
elseif class == "DRUID" then
self.text:SetTextColor(1.00, 0.49, 0.04)
elseif class == "PALADIN" then
self.text:SetTextColor(0.96, 0.55, 0.73)
elseif class == "HUNTER" then
self.text:SetTextColor(0.67, 0.83, 0.45)
elseif class == "ROGUE" then
self.text:SetTextColor(1.00, 0.96, 0.41)
elseif class == "SHAMAN" then
self.text:SetTextColor(0.0, 0.44, 0.87)
elseif class == "WARLOCK" then
self.text:SetTextColor(0.58, 0.51, 0.79)
elseif class == "DEATHKNIGHT" then
self.text:SetTextColor(0.77, 0.12, 0.23)
elseif class == "MONK" then
self.text:SetTextColor(0.33, 0.54, 0.52)
end
But just someone tell me what the MONK RGB 0-1 is? The one in the code above is wrong, that is from wow wiki and is not the right color. Thank you!