Advertisement
MortalityPastebin

Audio Visualizer

Mar 3rd, 2018
1,643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. local player = game:GetService("Players").LocalPlayer
  2. local char = player.Character
  3.  
  4. player.Chatted:connect(function(Said)
  5. if Said == ";on" then
  6. local Music = Instance.new("Sound", workspace)
  7. Music.SoundId = "http://www.roblox.com/asset/?id=547275939"
  8. Music.Volume = 1
  9. Music.Looped = true
  10. Music:Play()
  11. Music.Name = "VisualSong"
  12. local Visual = Instance.new("Part")
  13. Visual.Parent = workspace
  14. Visual.CanCollide = false
  15. Visual.Material = "Neon"
  16. Visual.Name = "Visual"
  17. game:GetService("RunService").RenderStepped:connect(function()
  18. Visual.CFrame = char.Torso.CFrame * CFrame.new(0, -5, -5)
  19. local Loudness = Music.PlaybackLoudness / 3
  20. Visual.Size = Vector3.new(0.5 ,Loudness, 0.5)
  21. end)
  22. end
  23. if Said == ";off" then
  24. local rem = workspace:FindFirstChild("Visual")
  25. local rem2 = workspace:FindFirstChild("VisualSong")
  26. if rem then
  27. rem:remove()
  28. end
  29. if rem2 then
  30. rem2:remove()
  31. end
  32. end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement