Advertisement
AndrewTheMaster

Audio wings

Jul 3rd, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. --Settings
  2.  
  3. local AudioId = 255905590
  4. local AudioVol = 2
  5. local AudioPit = 1
  6. local IsLooped = true
  7.  
  8. --Functions
  9.  
  10. local Parts = {}
  11. local Parts2 = {}
  12. local Direction = 1
  13. local loudness = 2
  14. local TColor = BrickColor.new("Black")
  15. for i = 1, 100 do
  16. local p = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  17. p.Size = Vector3.new(0.2, 0.2, 0.2)
  18. p.Anchored = true
  19. p.CanCollide = false
  20. p.Material = "Neon"
  21. p.Position = game.Players.LocalPlayer.Character.Torso.Position
  22. table.insert(Parts, p)
  23. end
  24. for i = 1, 100 do
  25. local p = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  26. p.Size = Vector3.new(0.2, 0.2, 0.2)
  27. p.Anchored = true
  28. p.CanCollide = false
  29. p.Material = "Neon"
  30. p.Position = game.Players.LocalPlayer.Character.Torso.Position
  31. table.insert(Parts2, p)
  32. end
  33. local sound = Instance.new("Sound", game.Players.LocalPlayer.Character.Torso)
  34. sound.SoundId = "http://www.roblox.com/asset?id="..AudioId
  35. sound.Volume = AudioVol
  36. sound.Pitch = AudioPit
  37. sound.Looped = IsLooped
  38. sound:Play()
  39. spawn(function()
  40. local SelectedPart = 0
  41. while true do
  42. if Direction == 1 then
  43. if SelectedPart < #Parts then
  44. SelectedPart = SelectedPart + Direction
  45. else
  46. Direction = -1
  47. TColor = BrickColor.Random()
  48. end
  49. elseif Direction == -1 then
  50. if SelectedPart > 1 then
  51. SelectedPart = SelectedPart + Direction
  52. else
  53. Direction = 1
  54. TColor = BrickColor.Random()
  55. end
  56. end
  57. local sel = Parts[SelectedPart]
  58. local sel2 = Parts2[SelectedPart]
  59. sel.BrickColor = BrickColor.Random()
  60. sel2.BrickColor = BrickColor.Random()
  61. loudness = sound.PlaybackLoudness / 500
  62. sel.Size = Vector3.new(loudness, loudness, 0.2)
  63. sel2.Size = Vector3.new(loudness, loudness, 0.2)
  64. wait()
  65. sel.BrickColor = TColor
  66. sel2.BrickColor = TColor
  67. end
  68. end)
  69. game:GetService("RunService").RenderStepped:connect(function()
  70. for i = 1, #Parts do
  71. if i == 1 then
  72. Parts[i].CFrame = Parts[i].CFrame:lerp(game.Players.LocalPlayer.Character.Torso.CFrame, 0.9)
  73. else
  74. Parts[i].CFrame = Parts[i].CFrame:lerp(Parts[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(-loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
  75. end
  76. end
  77. for i = 1, #Parts2 do
  78. if i == 1 then
  79. Parts2[i].CFrame = Parts2[i].CFrame:lerp(game.Players.LocalPlayer.Character.Torso.CFrame, 0.9)
  80. else
  81. Parts2[i].CFrame = Parts2[i].CFrame:lerp(Parts2[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
  82. end
  83. end
  84. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement