Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Author: 12GaugeNick
- File-Type: LocalScript
- Date: 10/16/2016
- Notes:
- *PLEASE DO NOT STEAL CREDIT FOR MY WORK!*
- ~Script will work on ScriptBuilder~
- ~Any sounds will work on this~
- --]]
- local OwnerName,Owner = "SSKADFF23", game.Players.LocalPlayer
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Content = game:GetService("ContentProvider")
- local Market = game:GetService("MarketplaceService")
- local SoundPos = 0
- local rad = math.rad
- local abs = math.abs
- local sin = math.sin
- local ScriptComplete = false
- local BreakLoop = false
- local Cam = workspace.CurrentCamera
- local Sound = Instance.new("Sound", Cam)
- local SoundData = {}
- local ChatConnections = {}
- local Bars = {}
- local LoadedEq = {}
- local Songs,SIndex = {
- 268362040,
- 180687152,
- 212377911,
- 438917260,
- 229406882,
- 173125494,
- 365768377,
- 240054278,
- 247813691,
- 142963968,
- 161498572,
- 285328190,
- 222370123,
- 359339539,
- },0
- ------------------------------------------------------------
- ----------------------- FUNCTIONS --------------------------
- ------------------------------------------------------------
- function gPart(Part)
- for Num,Part in next,Bars do
- if Part == Part then
- return Num
- end
- end
- end
- function fadeOut(Part)
- spawn(function()
- repeat RunService.Heartbeat:wait()
- Part.Transparency = Part.Transparency + .05
- until Part.Transparency>=1
- end)
- end
- function addBar(Size, Color)
- local Part = Instance.new("Part", Cam)
- Part.Material = "Neon"
- Part.Transparency = .5
- Part.Anchored = true
- Part.Size = Vector3.new(.2,Size or 1,.4)
- Part.CanCollide = false
- Part.Color = Color3.new(0,Color,0)
- delay(10,function()
- Part:Destroy()
- end)
- table.insert(Bars, Part)
- end
- function cLerp(p1,p2,percent)
- local p1x,p1y,p1z,p1R00,p1R01,p1R02,p1R10,p1R11,p1R12,p1R20,p1R21,p1R22=p1:components()
- local p2x,p2y,p2z,p2R00,p2R01,p2R02,p2R10,p2R11,p2R12,p2R20,p2R21,p2R22=p2:components()
- return CFrame.new(p1x+percent*(p2x-p1x),p1y+percent*(p2y-p1y),p1z+percent*(p2z-p1z),
- p1R00+percent*(p2R00-p1R00),p1R01+percent*(p2R01-p1R01),p1R02+percent*(p2R02-p1R02),
- p1R10+percent*(p2R10-p1R10),p1R11+percent*(p2R11-p1R11),p1R12+percent*(p2R12-p1R12),
- p1R20+percent*(p2R20-p1R20),p1R21+percent*(p2R21-p1R21),p1R22+percent*(p2R22-p1R22))
- end
- function connectChat(Player)
- Player.Chatted:connect(function(Msg)
- if Msg:sub(1,3) == "/e " then
- Msg = Msg:sub(4)
- end
- if Msg:lower():sub(1,4) == "next" then
- playSong()
- end
- if Msg:lower():sub(1,4) == "play" then
- playSong(Msg:sub(6))
- end
- if Msg:lower():sub(1,9) == "nightcore" then
- if not Sound:FindFirstChild("PitchShiftSoundEffect") then
- local effect = Instance.new("PitchShiftSoundEffect",Sound)
- effect.Octave = 1.4
- else
- pcall(function()
- Sound.PitchShiftSoundEffect:Destroy()
- end)
- end
- end
- if Msg:lower():sub(1,6) == "reverb" then
- if not Sound:FindFirstChild("ReverbSoundEffect") then
- Instance.new("ReverbSoundEffect",Sound)
- else
- pcall(function()
- Sound.ReverbSoundEffect:Destroy()
- end)
- end
- end
- end)
- end
- function songData(id, Data)
- return Market:GetProductInfo(id)[Data]
- end
- function sIndex()
- if SIndex >= #Songs then
- SIndex = 0
- end
- SIndex = SIndex + 1
- return Songs[SIndex]
- end
- function playSong(Id)
- BreakLoop = true
- Sound:Stop()
- Sound:ClearAllChildren()
- if Id == nil or not Id then
- Id = sIndex()
- end
- for i,v in next,Bars do
- v:Destroy()
- end
- repeat wait() print(#Bars) until #Bars==0
- BreakLoop = false
- Sound.SoundId = "rbxassetid://"..tostring(Id)
- Sound:Play()
- spawn(function()
- while wait(.05) do
- if BreakLoop == true then
- break
- end
- local Size = abs(Sound.PlaybackLoudness/70)
- local Trans = Sound.PlaybackLoudness
- local Color = (Sound.PlaybackLoudness/255)
- addBar(Size, Color)
- end
- end)
- end
- ------------------------------------------------------------
- ------------------------ LOOPS -----------------------------
- ------------------------------------------------------------
- for _,v in next,Songs do
- Content:Preload("rbxassetid://"..v)
- end
- RunService.Heartbeat:connect(function()
- if ScriptComplete then
- for i,Part in next,Bars do
- if Part.Parent == Cam then
- local Char,Pos = workspace:FindFirstChild(OwnerName),CFrame.new(0,5,0).p
- if Char then
- Char = (Char.Torso.CFrame*CFrame.new(0,3,0)).p
- end
- Part.CFrame = cLerp(Part.CFrame,CFrame.new(Pos)*CFrame.Angles(0,rad(i*(360/#Bars)),0)*CFrame.new(#Bars/9,0,0),.07)
- else
- table.remove(Bars, i)
- end
- end
- end
- end)
- ------------------------------------------------------------
- ------------------------ EVENTS ----------------------------
- ------------------------------------------------------------
- Sound.Changed:connect(function(Prop)
- if Prop == "Parent" and Sound.Parent ~= workspace then
- Sound = Instance.new("Sound",workspace)
- BreakLoop = true
- playSong()
- end
- end)
- Sound.Ended:connect(function()
- BreakLoop = true
- playSong()
- end)
- for _,Player in next,Players:GetChildren() do
- if Player.Name:lower() == OwnerName:lower() then
- ChatConnections[Player.UserId] = Player.UserId
- Owner = Player
- connectChat(Player)
- end
- end
- Players.PlayerAdded:connect(function(Player)
- if Player.Name:lower() == OwnerName:lower() then
- ChatConnections[Player.UserId] = Player.UserId
- Owner = Player
- connectChat(Player)
- end
- end)
- Players.PlayerRemoving:connect(function(Player)
- if ChatConnections[Player.UserId] then
- ChatConnections[Player.UserId] = nil
- end
- end)
- if not game:FindService("NetworkServer") then
- connectChat(Players:WaitForChild("Player1"))
- end
- ------------------------------------------------------------
- ----------------------- END SCRIPT -------------------------
- ------------------------------------------------------------
- ScriptComplete = true
- playSong()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement