Advertisement
Guest User

Flash Health and Mana Bar

a guest
May 9th, 2015
1,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.80 KB | None | 0 0
  1. init start    
  2. --               _________    _____           _       __      
  3. --              / ____/ (_)  / ___/__________(_)___  / /______
  4. --             / __/ / / /   \__ \/ ___/ ___/ / __ \/ __/ ___/
  5. --            / /___/ / /   ___/ / /__/ /  / / /_/ / /_(__  )
  6. --           /_____/_/_/   /____/\___/_/  /_/ .___/\__/____/  
  7. --                                         /_/      
  8.  
  9.     --   Name: Health & Mana Bar
  10.     --   Last Updated: 09/05/2015
  11.     --   Version: 1.0
  12.  
  13. -- you may change colors, I fuck gradients colors and I do not understand them at all.
  14.  
  15. local BORDER = true
  16. local SIZE = 380
  17. local HUD_Colors = {
  18.       MANA = {0.0, color(3, 131, 183, 20), 0.23, color(3, 131, 183, 20), 0.76, color(3, 131, 183, 20)},
  19.       HEALTH = {0.0, color(0, 210, 0, 20), 0.23, color(0, 220, 0, 20), 0.76, color(0, 220, 0, 20)},
  20. }
  21.  
  22. init end
  23.  
  24. if BORDER then
  25.    setbordercolor(color(0,0,0))
  26. end
  27.  
  28.  
  29. locationx =  $worldwinrelative.left + ($worldwinrelative.width / 2) - (SIZE/2) - 18
  30. locationy = $worldwinrelative.top + ($worldwinrelative.height / 2) - (SIZE/2)
  31.  
  32. locationx2 = locationx + SIZE - ((SIZE + (SIZE * 0.85)) / 2)
  33. locationy2 = locationy + SIZE - ((SIZE + (SIZE * 0.85)) / 2)
  34.  
  35. hp1 = 90 / (100 / $hppc)* - 1
  36. mp1 = 90 / (100 / $mppc)
  37.  
  38.  
  39. setantialiasing(true)
  40.  
  41.  
  42. drawpie(locationx, locationy, SIZE, SIZE, 45, -90)
  43. drawpie(locationx, locationy, SIZE, SIZE, 135, 90)
  44. setfillstyle('gradient', 'linear', 1, 0, 0, 0, 150)
  45.  
  46.  
  47. addgradcolors(unpack(HUD_Colors.MANA))
  48. drawpie(locationx, locationy, SIZE, SIZE, -45, mp1)
  49. setfillstyle('gradient', 'linear', 1, 0, 0, 0, 150)
  50.  
  51. -- hp bar
  52. addgradcolors(unpack(HUD_Colors.HEALTH))
  53. drawpie(locationx, locationy, SIZE, SIZE, 225, hp1)
  54.  
  55.  
  56. -- clear
  57. setbordercolor(-1) 
  58. setfillstyle('color', -1)
  59. drawcircle(locationx2, locationy2, SIZE * 0.85, SIZE * 0.85)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement