Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEFAULT_CHAT_FRAME:AddMessage("Health.lua was successfully loaded.")
- --Health % Value
- PF=CreateFrame("Frame")
- function sh(hp,hpm)
- local a
- if hp<1 then return b end -- if frame is death we do nothing
- if hp<10000 then a=hp end
- if hp>10000 then a=(hp-mod(hp,100))/1000 a=a.."k" end --if hp>10k
- if hp>100000 then a=(hp-mod(hp,1000))/1000 a=a.."k" end --if hp>100k
- if hp>1000000 then a=(hp-mod(hp,10000))/1000000 a=a.."m" end --if hp>1M
- if hp>10000000 then a=(hp-mod(hp,1000000))/1000000 a=a.."m" end --if hp>10M
- if hp>1000000000 then a=(hp-mod(hp,100000000))/1000000000 a=a.."b" end --if hp>1B
- if hp>10000000000 then a=(hp-mod(hp,1000000000))/1000000000 a=a.."b" end --if hp>10B
- a = a.." | "..format("%.0f", ((hp/hpm)*100)).."%"
- return a
- end
- pf2={"Player", "Target", "Focus"}
- PF:SetScript("OnUpdate",
- function()
- for _,u in ipairs(pf2) do
- _G[u.."FrameHealthBar"].TextString:SetText(sh(UnitHealth(u),UnitHealthMax(u)))
- _G[u.."FrameManaBar"].TextString:SetText(sh(UnitPower(u),UnitPowerMax(u)))
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement