Hello all you wonderful people! I need a script that changes the alpha of a panel when my character reaches a specific health %. Also, is it possible to have the panel "flash" by maybe cycling through different alpha levels, like 75->80>85>90>95>100>95 etc etc. I have no idea if you have to set specific alpha levels, or if you could just simply let the code animate it for you. But if that's too much of a hassle, or just straight up impossible, then that's totally fine.

Much love.

---------- Post added 2010-11-19 at 01:53 AM ----------

Nevermind, figured it out myself. Here's what I did for those who'd like to know.

OnLoad
Code:
self:RegisterEvent("UNIT_HEALTH");
OnEvent
Code:
if UnitHealth('player') / UnitHealthMax('player') <= 0.3 then
    self:SetAlpha(1) 
else
    self:SetAlpha(0) 
end