iOMelon

Rainbow projectiles v2

Jul 14th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. local color_list_proj = {rgb(255, 0, 0), rgb(255, 127, 0), rgb(255, 255, 0), rgb(127, 255, 0),
  2.                         rgb(0, 255, 0), rgb(0, 255, 127), rgb(0, 255, 255), rgb(0, 127, 255),
  3.                         rgb(0, 0, 255), rgb(127, 0, 255), rgb(255, 0, 255), rgb(255, 0, 127)} -- Colors from Ensis' rainbow damage numbers                     
  4. local color_idx_proj = 0 --index of which color the new projectile will have
  5. local color_idx_proj_timer = 0 --timer to get a 10 millisecond delay
  6. function onDamageNumberUpdate(dam_nums, hud, delta) --onDamageNumberCreate(dam_nums, number, loc, is_shield)
  7.  
  8.    --onDamageNumberUpdate code from a damage number script
  9.  
  10.     if color_idx_proj_timer == 9 then --checks if color_idx_proj_timer equals 9 (10 ms as it starts at 0)
  11.         color_idx_proj_timer = 0 --set color_idx_proj_timer to 0
  12.         if color_idx_proj == 12 then --checks if color_idx_proj is equal 12
  13.         color_idx_proj = 0 --changes value back to 0 if true
  14.         else
  15.         color_idx_proj = color_idx_proj + 1 --increases the value of color_idx_proj by 1 if false
  16.         end
  17.         local valc = color_list_proj[color_idx_proj % 12 + 1] --sets the value of valc to the current color from color_list_proj
  18.         setProjectileColor(getProjectile("SLD", "AR"), valc, 10) --sets projectile color
  19.         setProjectileColor(getProjectile("SLD", "Thumper DX"), valc, 10)
  20.     else
  21.     color_idx_proj_timer = color_idx_proj_timer + 1 --increases the value of color_idx_proj_timer by 1
  22.     do return end --exits the function
  23.     end
  24. end
Advertisement
Add Comment
Please, Sign In to add comment