local C=game:GetService("\080\108\097\121\101\114\115")local J=script.Parent local t=J:WaitForChild("\082\101\109\111\116\101")local O=C.LocalPlayer local m=O:WaitForChild("\080\108\097\121\101\114\071\117\105")local h local g local s=false function Action()if not h then local C=t:InvokeServer("\065\099\116\105\118\097\116\101")if C then ChooseSong()end else Unequip()end end function Unequip()if g then g:Disconnect()g=nil end if h then h:Destroy()h=nil end end function Equip(C)Unequip()C.Button1Down:Connect(Action)end function ChooseSong()if m:FindFirstChild("\067\104\111\111\115\101\083\111\110\103\071\117\105")then return end local C=Instance.new("\083\099\114\101\101\110\071\117\105")C.Name="\067\104\111\111\115\101\083\111\110\103\071\117\105"local J=Instance.new("\070\114\097\109\101")J.Style=Enum.FrameStyle.RobloxRound J.Size=UDim2.new(.25,0,.25,0)J.AnchorPoint=Vector2.new(.5,.5)J.Active=true J.Draggable=true J.Position=UDim2.new(.5,0,.5,0)J.Parent=C local O=Instance.new("\084\101\120\116\076\097\098\101\108")O.BackgroundTransparency=1 O.TextColor3=Color3.new(1,1,1)O.Font=Enum.Font.SourceSansBold O.TextStrokeTransparency=.75 O.TextScaled=true O.Size=UDim2.new(1,0,.5,0)O.Text="\080\117\116 \105\110 \116\104\101 \073\068 \110\117\109\098\101\114 \102\111\114 \097 \115\111\110\103 \116\104\097\116\'\115 \098\101\101\110 \117\112\108\111\097\100\101\100 \116\111 \082\079\066\076\079\088\046\n\076\101\097\118\101 \105\116 \098\108\097\110\107 \116\111 \115\116\111\112 \112\108\097\121\105\110\103 \109\117\115\105\099\046"O.Parent=J local d=Instance.new("\084\101\120\116\066\111\120")d.BackgroundColor3=Color3.new(0,0,0)d.BackgroundTransparency=.5 d.BorderColor3=Color3.new(1,1,1)d.TextColor3=Color3.new(1,1,1)d.Font=Enum.Font.SourceSansBold d.TextStrokeTransparency=.75 d.TextScaled=true d.Size=UDim2.new(1,0,.2,0)d.Position=UDim2.new(0,0,.5,0)d.Text="\073\068"d.Parent=J local Y=Instance.new("\084\101\120\116\066\117\116\116\111\110")Y.Style=Enum.ButtonStyle.RobloxButton Y.AnchorPoint=Vector2.new(.5,.5)Y.TextColor3=Color3.new(1,1,1)Y.Font=Enum.Font.SourceSansBold Y.TextStrokeTransparency=.75 Y.TextScaled=true Y.Size=UDim2.new(.75,0,.3,0)Y.Position=UDim2.new(.5,0,.85,0)Y.Text=s and"\083\116\111\112"or not s and"\080\108\097\121\033"Y.Parent=J g=Y.MouseButton1Click:Connect(function()if s then s=false Y.Text=s and"\083\116\111\112"or not s and"\080\108\097\121\033"t:InvokeServer("\080\108\097\121\083\111\110\103",d.Text,true)return end local J=t:InvokeServer("\080\108\097\121\083\111\110\103",d.Text,s)if J=="\083\117\099\099\101\115\115"then s=true C:Destroy()else O.Text=J delay(1.5,function()if O.Text==J then O.Text="\080\117\116 \105\110 \116\104\101 \073\068 \110\117\109\098\101\114 \102\111\114 \097 \115\111\110\103 \116\104\097\116\'\115 \098\101\101\110 \117\112\108\111\097\100\101\100 \116\111 \082\079\066\076\079\088\046\n\076\101\097\118\101 \105\116 \098\108\097\110\107 \116\111 \115\116\111\112 \112\108\097\121\105\110\103 \109\117\115\105\099\046"end end)end end)C.Parent=m h=C end J.Equipped:Connect(Equip)J.Unequipped:Connect(Unequip)
--[[
	// Filename: EarplugsClient.lua
	// Written by: Celebras
	// Date: 5/2/2018
	// Updated: 5/2/2018
--]]

local Players = game:GetService("Players")

local Tool = script.Parent
local Remote = Tool:WaitForChild("Remote")

local Plr = Players.LocalPlayer
local PlrGui = Plr:WaitForChild("PlayerGui")

local Gui
local Func

local Playing = false

function Action()
	if not Gui then
		local Response = Remote:InvokeServer("Activate")
		if Response then
			ChooseSong()
		end
	else
		Unequip()
	end
end

function Unequip()
	if Func then
		Func:Disconnect()
		Func = nil
	end

	if Gui then
		Gui:Destroy()
		Gui = nil
	end
end

function Equip(Mouse)
	Unequip()

	Mouse.Button1Down:Connect(Action)
end

function ChooseSong()
	if PlrGui:FindFirstChild("ChooseSongGui") then
		return
	end

	local SG = Instance.new("ScreenGui")
	SG.Name = "ChooseSongGui"

	local Frame = Instance.new("Frame")
	Frame.Style = Enum.FrameStyle.RobloxRound
	Frame.Size = UDim2.new(0.25, 0, 0.25, 0)
	Frame.AnchorPoint = Vector2.new(0.5, 0.5)
	Frame.Active = true
	Frame.Draggable = true
	Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
	Frame.Parent = SG

	local Text = Instance.new("TextLabel")
	Text.BackgroundTransparency = 1
	Text.TextColor3 = Color3.new(1, 1, 1)
	Text.Font = Enum.Font.SourceSansBold
	Text.TextStrokeTransparency = 0.75
	Text.TextScaled = true
	Text.Size = UDim2.new(1, 0, 0.5, 0)
	Text.Text = "Put in the ID number for a song that's been uploaded to ROBLOX.\nLeave it blank to stop playing music."
	Text.Parent = Frame

	local Input = Instance.new("TextBox")
	Input.BackgroundColor3 = Color3.new(0, 0, 0)
	Input.BackgroundTransparency = 0.5
	Input.BorderColor3 = Color3.new(1, 1, 1)
	Input.TextColor3 = Color3.new(1, 1, 1)
	Input.Font = Enum.Font.SourceSansBold
	Input.TextStrokeTransparency = 0.75
	Input.TextScaled = true
	Input.Size = UDim2.new(1, 0, 0.2, 0)
	Input.Position = UDim2.new(0, 0, 0.5, 0)
	Input.Text = "ID"
	Input.Parent = Frame

	local Button = Instance.new("TextButton")
	Button.Style = Enum.ButtonStyle.RobloxButton
	Button.AnchorPoint = Vector2.new(0.5, 0.5)
	Button.TextColor3 = Color3.new(1, 1, 1)
	Button.Font = Enum.Font.SourceSansBold
	Button.TextStrokeTransparency = 0.75
	Button.TextScaled = true
	Button.Size = UDim2.new(0.75, 0, 0.3, 0)
	Button.Position = UDim2.new(0.5, 0, 0.85, 0)
	Button.Text = Playing and "Stop" or not Playing and "Play!"
	Button.Parent = Frame

	Func = Button.MouseButton1Click:Connect(function()
		if Playing then
			Playing = false
			Button.Text = Playing and "Stop" or not Playing and "Play!"
			Remote:InvokeServer("PlaySong", Input.Text, true)
			return
		end

		local Response = Remote:InvokeServer("PlaySong", Input.Text, Playing)
		if Response == "Success" then
			Playing = true
			SG:Destroy()
		else
			Text.Text = Response
			delay(1.5, function()
				if Text.Text == Response then
					Text.Text =
						"Put in the ID number for a song that's been uploaded to ROBLOX.\nLeave it blank to stop playing music."
				end
			end)
		end
	end)

	SG.Parent = PlrGui

	Gui = SG
end

Tool.Equipped:Connect(Equip)
Tool.Unequipped:Connect(Unequip)
