Advertisement
Guest User

Untitled

a guest
Feb 5th, 2015
604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. --[[
  2. Author: Noya
  3. Date: 13.1.2015.
  4. Resizes the target for a duration then resizes back to the normal scale
  5. ]]
  6. function AvatarResize( event )
  7. -- Variables
  8. local caster = event.caster
  9. local ability = event.ability
  10. local duration = ability:GetLevelSpecialValueFor( "duration" , ability:GetLevel() - 1 )
  11. local model_size = ability:GetLevelSpecialValueFor( "model_size" , ability:GetLevel() - 1 )
  12.  
  13. local model_size_interval = 100 / ( model_size - 1 )
  14.  
  15. --Scale Up in 100 intervals
  16. for i=1,100 do
  17. Timers:CreateTimer( i/75,
  18. function()
  19. local modelScale = 1 + i/model_size_interval
  20. caster:SetModelScale( modelScale )
  21. end)
  22. end
  23.  
  24. --Scale Down 1 second after the duration ends
  25. for i=1,100 do
  26. Timers:CreateTimer( duration - 1 + (i/50),
  27. function()
  28. local modelScale = model_size - i/model_size_interval
  29. caster:SetModelScale( modelScale )
  30. end)
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement