Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- Part2 = Instance.new("Part")
- Part3 = Instance.new("Part")
- Part4 = Instance.new("Part")
- Part5 = Instance.new("Part")
- Tool0.Name = "KrY's BlueTooth Speaker"
- Tool0.Parent = owner['Backpack']
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(-8.68000126, 4.25000429, -14.0999937, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part1.Orientation = Vector3.new(0, 180, 0)
- Part1.Position = Vector3.new(-8.68000126, 4.25000429, -14.0999937)
- Part1.Rotation = Vector3.new(-180, 0, -180)
- Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part1.Size = Vector3.new(0.0700000077, 0.699999988, 0.699999988)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.BrickColor = BrickColor.new("Really black")
- Part1.Locked = true
- Part1.Material = Enum.Material.SmoothPlastic
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.brickColor = BrickColor.new("Really black")
- Part2.Parent = Tool0
- Part2.CFrame = CFrame.new(-7.42000055, 4.25000429, -14.0999937, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.Position = Vector3.new(-7.42000055, 4.25000429, -14.0999937)
- Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part2.Size = Vector3.new(0.0700000077, 0.699999988, 0.699999988)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.BrickColor = BrickColor.new("Really black")
- Part2.Locked = true
- Part2.Material = Enum.Material.SmoothPlastic
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.brickColor = BrickColor.new("Really black")
- Part3.Name = "Handle"
- Part3.Parent = Tool0
- Part3.CFrame = CFrame.new(-8.0500021, 4.25000429, -14.0999937, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.Position = Vector3.new(-8.0500021, 4.25000429, -14.0999937)
- Part3.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part3.Size = Vector3.new(1.05000019, 0.699999988, 0.699999988)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.BrickColor = BrickColor.new("Really black")
- Part3.Locked = true
- Part3.Material = Enum.Material.SmoothPlastic
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.brickColor = BrickColor.new("Really black")
- Part4.Name = "led"
- Part4.Parent = Tool0
- Part4.CFrame = CFrame.new(-7.48999977, 4.25000429, -14.0999937, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part4.Position = Vector3.new(-7.48999977, 4.25000429, -14.0999937)
- Part4.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part4.Size = Vector3.new(0.0700000077, 0.699999988, 0.699999988)
- Part4.BottomSurface = Enum.SurfaceType.Smooth
- Part4.BrickColor = BrickColor.new("Institutional white")
- Part4.Locked = true
- Part4.Material = Enum.Material.Neon
- Part4.TopSurface = Enum.SurfaceType.Smooth
- Part4.brickColor = BrickColor.new("Institutional white")
- Part5.Name = "led"
- Part5.Parent = Tool0
- Part5.CFrame = CFrame.new(-8.61000061, 4.25000429, -14.0999937, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part5.Orientation = Vector3.new(0, 180, 0)
- Part5.Position = Vector3.new(-8.61000061, 4.25000429, -14.0999937)
- Part5.Rotation = Vector3.new(-180, 0, -180)
- Part5.Color = Color3.new(0.972549, 0.972549, 0.972549)
- Part5.Size = Vector3.new(0.0700000077, 0.699999988, 0.699999988)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.BrickColor = BrickColor.new("Institutional white")
- Part5.Locked = true
- Part5.Material = Enum.Material.Neon
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.brickColor = BrickColor.new("Institutional white")
- local plr = owner
- local char = plr.Character
- local hum = char:FindFirstChildOfClass("Humanoid")
- local tool = Tool0
- local handle = nil
- local led = {}
- for i,v in pairs(tool:GetChildren()) do
- if v:IsA("BasePart") or v:IsA("UnionOperation") --[[and v:CanSetNetworkOwnership()]] then
- v.CanCollide = false
- --v:SetNetworkOwner(plr)
- end
- if v.Name == 'Handle' then
- handle = v
- elseif v.Name == 'led' then
- table.insert(led,1,v)
- end
- end
- for i,v in pairs(tool:GetChildren()) do
- if v ~= handle then
- local weld = Instance.new("Weld")
- weld.Part0 = handle
- weld.Part1 = v
- weld.C0 = handle.CFrame:Inverse()
- weld.C1 = v.CFrame:Inverse()
- weld.Parent = v
- end
- end
- local mrd1,mrd2,mrd3 = math.random(300,400),math.random(600,700),math.random(400,600)
- local prefix = '/'
- local songid = 0
- local volume = 1
- local speed = 1
- local last_time = 0
- local loudness = 0
- local looped = true
- local playing = false
- local bassing = {}
- local origin_size = Vector3.new(3,3,3)
- local max_size = Vector3.new(4.5,4.5,4.5)
- local ls
- local songval,remote,ls,song
- function create_nls_remote()
- if (owner or plr) then else return end
- if not remote or not remote.Parent then
- remote = Instance.new("RemoteEvent")
- remote.Parent = (owner or plr)['PlayerGui']
- songval = Instance.new("ObjectValue")
- songval.Name = 'songval'
- songval.Value = song
- songval.Parent = remote
- remote.OnServerEvent:Connect(function(lplr,loud)
- loudness = loud
- end)
- end
- if not ls or not ls.Parent then
- NLS([[
- local remote = script.Parent
- local objval,song
- game:GetService("RunService").RenderStepped:Connect(function()
- if not objval or not objval.Parent then
- objval = remote:FindFirstChild('songval')
- end
- if objval and not song or not song.Parent then
- repeat wait() until objval.Value
- song = objval.Value
- end
- if song and song.Parent then
- remote:FireServer(song.PlaybackLoudness)
- wait(0.1)
- end
- end)
- ]],remote)
- ls = remote:FindFirstChildOfClass('LocalScript')
- end
- end
- function chat(hplr)
- hplr.Chatted:Connect(function(msg)
- if hplr == plr then
- if msg:lower():sub(1,4) == "vol" ..prefix then
- local choice = msg:sub(5)
- if tonumber(choice) then
- volume = choice
- song.Volume = choice
- end
- end
- --
- if msg:lower():sub(1,7) == "/e vol" ..prefix then
- local choice = msg:sub(8)
- if tonumber(choice) then
- volume = choice
- song.Volume = choice
- end
- end
- --[[
- if msg:lower():sub(1,5) == "loop" ..prefix then
- local choice = msg:sub(6)
- if choice == "false" then
- looped = false
- song.Looped = false
- elseif choice == "true" then
- looped = true
- song.Looped = true
- end
- end
- --
- if msg:lower():sub(1,8) == "/e loop" ..prefix then
- local choice = msg:sub(9)
- if choice == "false" then
- looped = false
- song.Looped = false
- elseif choice == "true" then
- looped = true
- song.Looped = true
- end
- end
- --]]
- if msg:lower():sub(1,5) == "play" ..prefix then
- songid = msg:sub(6)
- if tonumber(songid) then
- last_time = 0
- song.TimePosition = 0
- song.SoundId = 'rbxassetid://' .. songid
- song:Destroy()
- end
- end
- --
- if msg:lower():sub(1,8) == "/e play" ..prefix then
- songid = msg:sub(9)
- if tonumber(songid) then
- last_time = 0
- song.TimePosition = 0
- song.SoundId = 'rbxassetid://' .. songid
- song:Destroy()
- end
- end
- --[[
- if msg:lower():sub(1,5) == "stop" ..prefix then
- song:Stop()
- end
- --
- if msg:lower():sub(1,8) == "/e stop" ..prefix then
- song:Stop()
- end
- --
- if msg:lower():sub(1,6) == "pause" ..prefix then
- song:Pause()
- end
- --
- if msg:lower():sub(1,9) == "/e pause" ..prefix then
- song:Pause()
- end
- --
- if msg:lower():sub(1,7) == "resume" ..prefix then
- song:Resume()
- end
- --
- if msg:lower():sub(1,10) == "/e resume" ..prefix then
- song:Resume()
- end
- --]]
- if msg:lower():sub(1,5) == "skip" ..prefix then
- local t = msg:sub(6)
- if tonumber(t) then
- last_time = t
- song.TimePosition = t
- end
- end
- --
- if msg:lower():sub(1,8) == "/e skip" ..prefix then
- local t = msg:sub(9)
- if tonumber(t) then
- last_time = t
- song.TimePosition = t
- end
- end
- if msg:lower():sub(1,6) == "speed" ..prefix then
- local choice = msg:lower():sub(7)
- if tonumber(choice) then
- speed = choice
- song.PlaybackSpeed = tonumber(speed)
- end
- end
- --
- if msg:lower():sub(1,9) == "/e speed" ..prefix then
- local choice = msg:lower():sub(10)
- if tonumber(choice) then
- speed = choice
- song.PlaybackSpeed = tonumber(speed)
- end
- end
- --
- end
- end)
- end
- function recolor(p)
- if p then else return end
- game:GetService("TweenService"):Create(p,TweenInfo.new(0.5),{Color = Color3.new(loudness / mrd1,loudness / mrd2,loudness / mrd3)}):Play()
- end
- function add_bass_shadow(part)
- if not bassing[part] then else return end
- bassing[part] = true
- local shadow = Instance.new("Part")
- shadow.Anchored = true
- shadow.CanCollide = false
- shadow.Locked = true
- shadow.Transparency = 0.4
- shadow.Material = Enum.Material.ForceField
- shadow.Position = part.Position
- shadow.Size = Vector3.new(1.6,1.6,1.6)
- local sphere = Instance.new("SpecialMesh")
- sphere.MeshType = Enum.MeshType.Sphere
- sphere.Parent = shadow
- local emit = Instance.new("ParticleEmitter")
- emit.Rotation = NumberRange.new(0, 360)
- emit.Color = ColorSequence.new(Color3.new(1, 0.878431, 0.431373),part.Color)
- emit.LightEmission = 0.4
- emit.Texture = "rbxassetid://203216563"
- emit.Transparency = NumberSequence.new(0.5,0.75,1)
- emit.Size = NumberSequence.new(0.3125,0.5625,0.60509598255157,0.5,0.3821650147438)
- emit.Lifetime = NumberRange.new(0.5, 0.75)
- emit.Rate = 25
- emit.RotSpeed = NumberRange.new(-500, 500)
- emit.SpreadAngle = Vector2.new(360, 360)
- emit.Speed = NumberRange.new(2, 3)
- emit.Rotation = NumberRange.new(0, 360)
- emit.LockedToPart = true
- emit.Parent = shadow
- shadow.Parent = workspace
- coroutine.resume(coroutine.create(function()
- emit.Enabled = true
- wait(0.1)
- emit.Enabled = false
- bassing[part] = false
- coroutine.yield()
- end))
- game:GetService("TweenService"):Create(shadow,TweenInfo.new(0.2),{Size = shadow.Size*2.1,Transparency = 1}):Play()
- game:GetService("Debris"):AddItem(shadow,2)
- end
- function bass(p)
- local division_size = loudness/300
- local make_size = origin_size+Vector3.new(division_size,division_size,division_size)
- if make_size.Y > max_size.Y then
- add_bass_shadow(p)
- end
- end
- function alive()
- local r = false
- if plr and plr.Parent and char and char.Parent and hum and hum.Parent and hum.Health > 0 then
- r = true
- end
- return r
- end
- tool.Equipped:Connect(function()
- char = tool.Parent
- plr = game:GetService("Players"):GetPlayerFromCharacter(char)
- pcall(function()
- hum = char:FindFirstChildOfClass("Humanoid")
- end)
- if alive() then
- playing = true
- chat(plr)
- else
- plr,char,hum = nil,nil,nil
- tool.Parent = workspace
- if tool.Parent ~= workspace then
- playing = false
- end
- end
- end)
- tool.Unequipped:Connect(function()
- if tool.Parent ~= workspace then
- playing = false
- end
- plr,char,hum = nil,nil,nil
- end)
- warn([[
- -[ KrY's BlueTooth Speaker ]-
- -[ Commands while holding ]-
- - play/id
- - speed/number
- - skip/timestamp
- - vol/number
- ]])
- spawn(function()
- while wait(0.1) do
- create_nls_remote()
- end
- end)
- game:GetService("RunService").Heartbeat:Connect(function()
- pcall(function()
- songval.Value = song
- if not song or not song.Parent then
- song = Instance.new("Sound")
- song.SoundId = "rbxassetid://" .. songid
- if playing then
- song.Volume = volume
- else
- song.Volume = 0
- end
- song.Looped = true -- looped
- song.PlaybackSpeed = speed
- song.TimePosition = last_time
- song.Parent = handle
- song:Play()
- end
- if song then
- if playing then
- song.Volume = volume
- else
- song.Volume = 0
- end
- song.Looped = true -- looped
- song.PlaybackSpeed = speed
- song.Parent = handle
- last_time = song.TimePosition
- song:Resume()
- end
- end)
- if playing then
- bass(handle)
- for i,v in pairs(led) do
- recolor(v)
- end
- end
- end)
Add Comment
Please, Sign In to add comment