Advertisement
tomonaoboys

Audio Visualizer maybe

Oct 22nd, 2017
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.38 KB | None | 0 0
  1. --270274342
  2. --305047121
  3. --586066792
  4. --692875664
  5. --277784505
  6. --670991496
  7. script.Parent=nil
  8. local PL=game:FindFirstChildOfClass("Players").LocalPlayer
  9. local RunService=game:GetService("RunService")local idk=true
  10. local Sound=Instance.new("Sound")
  11. function so(Id,Volume,spd)
  12.     if PL:FindFirstChild("Sound")then if PL.Sound:FindFirstChildOfClass("Sound")==nil then Instance.new("Sound",PL.Sound)end local smo=PL.Sound:Clone()local e=smo:FindFirstChildOfClass("Sound")e.SoundId=Id e.Volume=Volume if spd~=nil then e.PlaybackSpeed=spd smo.Parent=workspace return e end
  13.     else local m=Instance.new("Model",PL)m.Name="Sound"Instance.new("Sound",m)local smo=m:Clone()local e=smo:FindFirstChildOfClass("Sound")e.SoundId=Id e.Volume=Volume if spd~=nil then e.PlaybackSpeed=spd return e end
  14.     end
  15. end
  16. local function swait(num)
  17.     if num~=nil then
  18.         for i=1,num do
  19.             game:GetService("RunService").RenderStepped:wait()
  20.         end
  21.     else
  22.         game:GetService("RunService").RenderStepped:wait()
  23.     end
  24. return true
  25. end
  26. Sound.Parent=PL local width=.1
  27. Sound.SoundId = "rbxassetid://586066792"--"rbxassetid://609158214"
  28. Sound.Looped = true local Block=32 local Range=8 local SizeX=.05 local SizeZ=.05 local mode=-1 local spd=.05 local add=5 local rot=0 local rotadd=0 local GSize=1
  29. local SizeY=1
  30. local loud=false local Textured=false
  31. local lvl=.5--100000001
  32. local lpr=55 local pos=Vector3.new()
  33. local Vol=100 local Pbs=1 local SoundId="609158214"local Show="Bar" local Period=6 local BLightE=0
  34. local mod=Instance.new("Model",workspace)mod.Name="It's raining TACOS!"local col=Color3.new(1,1,1)local somethingidk=0
  35. local Blocks={}
  36. function Create()
  37.     mod:ClearAllChildren()
  38.     if Show=="Bar"then
  39.     for i=1,Block do Blocks[i]=Instance.new("Part")
  40.     Blocks[i].CFrame=CFrame.new(pos)*CFrame.Angles(0,math.rad(360/Block)*i+math.rad(rot),0)*CFrame.new(Range,0,0)Blocks[i].Color=col
  41.     Blocks[i].Material="Neon"
  42.     --Blocks[i].Size=Vector3.new(SizeX, Sound.PlaybackLoudness/200*math.sin(360/Block*i+somethingidk)*Sound.Volume*SizeY ,SizeZ)
  43.     Blocks[i].Size=Vector3.new(SizeX,math.abs(Sound.PlaybackLoudness/200*(math.sin((i/Block)*(math.pi*Period)+somethingidk))*Sound.Volume*SizeY),SizeZ)
  44.     Blocks[i].CanCollide=false Blocks[i].Anchored=true
  45.     Blocks[i].Parent=mod
  46.     end
  47.     elseif Show=="Box"then
  48.         local Box=Instance.new("Part")
  49.         Box.Size=Vector3.new(Sound.PlaybackLoudness/200*GSize,Sound.PlaybackLoudness/200*GSize,Sound.PlaybackLoudness/200*GSize)
  50.         Box.Position=pos+Vector3.new(0,Range,0)Box.CanCollide=false Box.Anchored=false
  51.         Box.Color=col Box.Material="Neon"Box.Orientation=Vector3.new(math.sin(rot)*30,math.cos(rot),rot)
  52.         Box.Parent=mod
  53.     elseif Show=="Beam"then
  54.     local first=nil
  55.     for i=1,Block do
  56.     Blocks[i]=Instance.new("Part")
  57.     Blocks[i].CFrame=CFrame.new(pos)*CFrame.Angles(0,math.rad(360/Block)*i+math.rad(rot),0)*CFrame.new(Range,0,0)Blocks[i].Color=col
  58.     Blocks[i].Material="Neon"Blocks[i].Transparency=1
  59.     Blocks[i].Size=Vector3.new()local a=Instance.new("Attachment",Blocks[i])if i==1 then first=a end
  60.     Blocks[i].CanCollide=false Blocks[i].Anchored=true
  61.     if Blocks[i-1]and i~=1 then if Blocks[i-1]:FindFirstChild("Attachment")then local b=Instance.new("Beam",Blocks[i])b.Attachment0=Blocks[i-1].Attachment b.Attachment1=a b.Enabled=true b.Segments=1 b.Width0=width b.Width1=width b.Transparency=NumberSequence.new(0)b.FaceCamera=true b.Color=ColorSequence.new(col)b.LightEmission=BLightE if Textured then b.Texture="rbxassetid://1251856844"end end end
  62.     if i==Block then local b=Instance.new("Beam",first.Parent)b.Attachment0=first b.Attachment1=a  b.Enabled=true b.Segments=1 b.Width0=width b.Width1=width b.Transparency=NumberSequence.new(0)b.FaceCamera=true b.Color=ColorSequence.new(col)b.LightEmission=BLightE  if Textured then b.Texture="rbxassetid://1251856844"end end
  63.     Blocks[i].Parent=mod
  64.     end
  65.     mod.Parent=workspace
  66.     end
  67. end local WBAc=500 local revb=false
  68. local rdcy=1.5
  69. local rden=1
  70. local rdiff=1
  71. local rdry=06
  72. local rpr=0
  73. local rwet=0
  74. local function ToMesh(Part)
  75.     local Mesh=Instance.new("SpecialMesh",Part)
  76.     if Part.Shape==Enum.PartType.Block then Mesh.MeshType="Brick"elseif Part.Shape==Enum.PartType.Ball then Mesh.MeshType="Sphere"elseif Part.Shape==Enum.PartType.Cylinder then Mesh.MeshType="Cylinder"end
  77.     Mesh.Scale=Part.Size*20 Part.Size=Vector3.new()
  78.     return Mesh
  79. end
  80. local function dood(msg)
  81.             if msg:sub(1,4) == "Play" then
  82.             Sound:Stop()SoundId = msg:sub(6)Sound:Play()end
  83.             if msg:sub(1,3)=="Vol"then Vol=tonumber(msg:sub(5))end
  84.             if msg:sub(1,3)=="pbs"then Pbs=tonumber(msg:sub(5))/100 end
  85.             if msg=="ChangeParent"then if idk then idk=false else idk=true end end
  86.             if msg:sub(1,6)=="Blocks"then if tonumber(msg:sub(8))~=nil then Block=tonumber(msg:sub(8))Create()end end
  87.             if msg:sub(1,5)=="Range"then if tonumber(msg:sub(7))~=nil then Range=tonumber(msg:sub(7))end end
  88.             if msg:sub(1,5)=="SizeX"then if tonumber(msg:sub(7))~=nil then SizeX=tonumber(msg:sub(7))end end
  89.             if msg:sub(1,5)=="SizeY"then if tonumber(msg:sub(7))~=nil then SizeY=tonumber(msg:sub(7))end end
  90.             if msg:sub(1,5)=="SizeZ"then if tonumber(msg:sub(7))~=nil then SizeZ=tonumber(msg:sub(7))end end
  91.             if msg:sub(1,4)=="Size"then if tonumber(msg:sub(6))~=nil then GSize=tonumber(msg:sub(6))end end
  92.             if msg:sub(1,5)=="Speed"then if tonumber(msg:sub(7))~=nil then spd=tonumber(msg:sub(7)/100)end end
  93.             if msg:sub(1,3)=="Add"then if tonumber(msg:sub(5))~=nil then add=tonumber(msg:sub(5))end end
  94.             if msg:sub(1,3)=="Rot"then if tonumber(msg:sub(5))~=nil then rotadd=tonumber(msg:sub(5))/10 end end
  95.             if msg:sub(1,6)=="Period"then if tonumber(msg:sub(8))~=nil then Period=tonumber(msg:sub(8))end end
  96.             if msg=="a:WB"then mode=0 end if msg=="a:Rainbow"then mode=1 end
  97.             if msg=="a:def"then mode=-1 end
  98.             if msg=="s:Bar"then Show="Bar"Create()end
  99.             if msg=="s:Box"then Show="Box"Create()end
  100.             if msg=="s:Beam"then Show="Beam"Create()end
  101.             if msg:sub(1,4)=="b:le"then if tonumber(msg:sub(6))~=nil then BLightE=tonumber(msg:sub(6))Create()end end
  102.             if msg:sub(1,4)=="b:wd"then if tonumber(msg:sub(6))~=nil then width=tonumber(msg:sub(6))Create()end end
  103.  
  104.             if msg=="o:l:is"then if loud then loud=false else loud=true end end
  105.             if msg:sub(1,6)=="o:l:pr"then if tonumber(msg:sub(8))~=nil then lpr=tonumber(msg:sub(8))end end
  106.             if msg:sub(1,6)=="o:l:lv"then if tonumber(msg:sub(8))~=nil then lvl=tonumber(msg:sub(8))/100 end end
  107.            
  108.             if msg=="o:r:is"then if revb then revb=false else revb=true end end
  109.             if msg:sub(1,6)=="o:r:pr"then if tonumber(msg:sub(8))~=nil then rpr=tonumber(msg:sub(8))end end
  110.             if msg:sub(1,6)=="o:r:de"then if tonumber(msg:sub(8))~=nil then rden=tonumber(msg:sub(8))end end
  111.             if msg:sub(1,6)=="o:r:pr"then if tonumber(msg:sub(8))~=nil then rpr=tonumber(msg:sub(8))end end
  112.             if msg:sub(1,6)=="o:r:di"then if tonumber(msg:sub(8))~=nil then rdiff=tonumber(msg:sub(8))end end
  113.             if msg:sub(1,6)=="o:r:dr"then if tonumber(msg:sub(8))~=nil then rdry=tonumber(msg:sub(8))end end
  114.             if msg:sub(1,6)=="o:r:wt"then if tonumber(msg:sub(8))~=nil then rwet=tonumber(msg:sub(8))end end
  115.            
  116.             if msg=="!txt"then if Textured then Textured=false else Textured=true end Create()end
  117.             if msg:sub(1,4)=="?:Ac"then if tonumber(msg:sub(6))~=nil then WBAc=tonumber(msg:sub(6))end end
  118. end
  119. PL.Chatted:connect(dood)
  120. local pos=Vector3.new()
  121. local cR=255
  122. local cG=0
  123. local cB=0
  124. local flg5=1
  125. Create()local oldsuck=nil local shk=false
  126. RunService.Heartbeat:connect(function()if oldsuck~=nil then oldsuck:Destroy()oldsuck=nil end
  127.     rot=rot+rotadd
  128.     if mode==1 then if cR>=255 then flg5=1 end
  129.     if cG>=255 then flg5=2 end
  130.     if cB>=255 then flg5=3 end
  131.     if flg5==1 then cR=cR-add cG=cG+add end
  132.     if flg5==2 then cG=cG-add cB=cB+add end
  133.     if flg5==3 then cB=cB-add cR=cR+add end
  134.     col=Color3.fromRGB(cR,cG,cB)elseif mode==0 then col=Color3.new(Sound.PlaybackLoudness/WBAc,Sound.PlaybackLoudness/WBAc,Sound.PlaybackLoudness/WBAc)elseif mode==-1 then col=Color3.new(1,1,1)end
  135.     if Sound.Parent==nil then Sound=so("rbxassetid://"..SoundId,Vol,Pbs)Sound.Looped=true Sound:Play()end
  136.     Sound.Volume=Vol
  137.     if Sound.SoundId~="rbxassetid://"..SoundId then Sound.SoundId="rbxassetid://"..SoundId end
  138.     somethingidk=somethingidk+spd
  139.     if loud then
  140.         if Sound:FindFirstChild("ripear")then
  141.             local earbleep = Sound.ripear
  142.             earbleep.Enabled = true
  143.             earbleep.Level = lvl
  144.             earbleep.Priority = lpr
  145.         else
  146.             local earbleep = Instance.new("DistortionSoundEffect",Sound)earbleep.Name="ripear"
  147.             earbleep.Enabled = true
  148.             earbleep.Level = lvl
  149.             earbleep.Priority = lpr
  150.            
  151.         end
  152.     else
  153.         if Sound:FindFirstChild("ripear")then
  154.             Sound.ripear:Destroy()
  155.         end
  156.     end
  157.  
  158.     if revb then
  159.         if Sound:FindFirstChild("reverb")then
  160.             local earbleep = Sound.reverb
  161.             earbleep.Enabled = true
  162.             earbleep.Density = rden
  163.             earbleep.Diffusion = rdiff
  164.             earbleep.DryLevel=rdry
  165.             earbleep.WetLevel=rwet
  166.             earbleep.Priority = rpr
  167.         else
  168.             local earbleep = Instance.new("ReverbSoundEffect",Sound)earbleep.Name="reverb"
  169.             earbleep.Enabled = true
  170.             earbleep.Density = rden
  171.             earbleep.Diffusion = rdiff
  172.             earbleep.DryLevel=rdry
  173.             earbleep.WetLevel=rwet
  174.             earbleep.Priority = rpr
  175.            
  176.         end
  177.     else
  178.         if Sound:FindFirstChild("reverb")then
  179.             Sound.reverb:Destroy()
  180.         end
  181.     end
  182.     if mod==nil or mod.Parent==nil then mod=Instance.new("Model",workspace)mod.Name="It's raining TACOS!"end
  183.     if PL.Character then
  184.         if PL.Character:FindFirstChild("HumanoidRootPart")then
  185.             pos=pos:lerp(PL.Character.HumanoidRootPart.Position,.2)
  186.         end
  187.     end
  188.     if idk then
  189.         if PL.Character then
  190.             if PL.Character:FindFirstChild("HumanoidRootPart")then
  191.                 Sound.Parent=PL.Character.HumanoidRootPart
  192.             end
  193.         end
  194.     else
  195.         Sound.Parent=PL
  196.     end
  197.     if Show=="Bar"then
  198.     for i=1,Block do
  199.     Blocks[i].CFrame=CFrame.new(pos)*CFrame.Angles(0,math.rad(360/Block)*i+math.rad(rot),0)*CFrame.new(Range,0,0)Blocks[i].Color=col
  200.     Blocks[i].Material="Neon"
  201.     Blocks[i].Size=Vector3.new(SizeX,math.abs(Sound.PlaybackLoudness/200*(math.sin((i/Block)*(math.pi*Period)+somethingidk))*Sound.Volume*SizeY),SizeZ)
  202.     Blocks[i].CanCollide=false Blocks[i].Anchored=true
  203.     Blocks[i].Parent=mod
  204.     end
  205.     elseif Show=="Box"then local Box=Instance.new("Part")
  206.         Box.Size=Vector3.new(Sound.PlaybackLoudness/200*GSize,Sound.PlaybackLoudness/200*GSize,Sound.PlaybackLoudness/200*GSize)
  207.         Box.Position=pos+Vector3.new(0,Range,0)Box.CanCollide=false Box.Anchored=true
  208.         Box.Color=col Box.Material="Neon"Box.Orientation=Vector3.new(math.sin(rot)*30,math.cos(rot),rot)
  209.         Box.Parent=mod oldsuck=Box
  210.         if not shk and Sound.PlaybackLoudness/200>1.1 then shk=true local c=Box:Clone()c.Parent=mod
  211.         local mesh=ToMesh(c)
  212.         spawn(function()for i=.5,1,.05 do mesh.Scale=mesh.Scale+Vector3.new(.5,.5,.5) c.Transparency=i swait()end c:Destroy()end)end
  213.         if shk and Sound.PlaybackLoudness/200>.4 then shk=false end
  214.     elseif Show=="Beam"then
  215.     local first=nil
  216.     for i=1,Block do
  217.     Blocks[i].CFrame=CFrame.new(pos)*CFrame.Angles(0,math.rad(360/Block)*i+math.rad(rot),0)*CFrame.new(Range,0,0)Blocks[i].Color=col
  218.     Blocks[i].Material="Neon"Blocks[i].Transparency=1
  219.     Blocks[i].Size=Vector3.new()Blocks[i].CFrame=CFrame.new(pos)*CFrame.Angles(0,math.rad(360/Block)*i+math.rad(rot),0)*CFrame.new(Range,Sound.PlaybackLoudness/200*(math.sin((i/Block)*(math.pi*Period*2)+somethingidk))*Sound.Volume*SizeY/3,0)
  220.     Blocks[i].CanCollide=false Blocks[i].Anchored=true
  221.     if Blocks[i]:FindFirstChildOfClass("Beam")then Blocks[i]:FindFirstChildOfClass("Beam").Color=ColorSequence.new(col)end
  222.     Blocks[i].Parent=mod
  223.     end
  224.     mod.Parent=workspace
  225.     end
  226. end)
  227. local name="GUIthatidk"
  228. spawn(function()while wait()do if PL:FindFirstChildOfClass("PlayerGui"):FindFirstChild(name)==nil then local idk=Instance.new("ScreenGui",PL:FindFirstChildOfClass("PlayerGui"))idk.ResetOnSpawn=false local t=Instance.new("TextBox",idk)t.Size=UDim2.new(.225,0,0,22)
  229. t.Position=UDim2.new(.5-.064,0,0,0)t.BackgroundTransparency=.5 t.Text="Audio Commands here"t.BorderSizePixel=0 t.TextXAlignment="Left"
  230. spawn(function()while wait()do t.BackgroundColor3=col if t.Parent then if t.Parent.Parent then else break end else break end end end)
  231. t.TextStrokeTransparency=0 t.TextColor3=Color3.new(1,1,1)t.TextScaled=true t.TextSize=15 idk.Name=name
  232. t.FocusLost:connect(function(ep)if ep then dood(t.Text)t.Text="Audio Commands hare"end end)t.Draggable=true
  233. local function commandinputstart(actionName,userInputState,inputObject)
  234.     if userInputState==Enum.UserInputState.Begin then
  235.         wait()t:CaptureFocus()
  236.     end
  237. end
  238. game.ContextActionService:BindAction("CommandInputStart",commandinputstart,false,Enum.KeyCode.LeftBracket)
  239. end end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement