return function(S,z,J,U,K)z=string.lower(z)U=U or.15 K=K or false local t={}if z=="\109\111\117\115\101\100\111\119\110"then t[#t+1]=S.MouseButton1Down:Connect(function()_L.Audio.Play(J,script,K and math.random(95,105)/100 or 1,U*2)end)elseif z=="\109\111\117\115\101\117\112"then t[#t+1]=S.MouseButton1Up:Connect(function()_L.Audio.Play(J,script,K and math.random(95,105)/100 or 1,U*2)end)elseif z=="\109\111\117\115\101\101\110\116\101\114"then t[#t+1]=S.MouseEnter:Connect(function()_L.Audio.Play(J,script,K and math.random(95,105)/100 or 1,U)end)elseif z=="\109\111\117\115\101\108\101\097\118\101"then t[#t+1]=S.MouseLeave:Connect(function()_L.Audio.Play(J,script,K and math.random(95,105)/100 or 1,U)end)elseif z=="\109\111\117\115\101\099\108\105\099\107"then t[#t+1]=S.MouseButton1Click:Connect(function()_L.Audio.Play(J,script,K and math.random(95,105)/100 or 1,U)end)end return function()for S,z in ipairs(t)do z:disconnect()end t=nil end end
--- Add sounds when interacting with a gui element

return function(element, interactType, interactSoundId, interactSoundVolume, enableRandomPitch)
	--- Variables
	interactType = string.lower(interactType)
	interactSoundVolume = interactSoundVolume or 0.15
	enableRandomPitch = enableRandomPitch or false
	--
	local events = {}

	--- Events
	if interactType == "mousedown" then
		--- Mouse down
		events[#events + 1] = element.MouseButton1Down:Connect(function()
			_L.Audio.Play(
				interactSoundId,
				script,
				(enableRandomPitch and math.random(95, 105) / 100 or 1),
				interactSoundVolume * 2
			)
		end)
	elseif interactType == "mouseup" then
		--- Mouse up
		events[#events + 1] = element.MouseButton1Up:Connect(function()
			_L.Audio.Play(
				interactSoundId,
				script,
				(enableRandomPitch and math.random(95, 105) / 100 or 1),
				interactSoundVolume * 2
			)
		end)
	elseif interactType == "mouseenter" then
		--- Mouse hover over
		events[#events + 1] = element.MouseEnter:Connect(function()
			_L.Audio.Play(
				interactSoundId,
				script,
				(enableRandomPitch and math.random(95, 105) / 100 or 1),
				interactSoundVolume
			)
		end)
	elseif interactType == "mouseleave" then
		--- Mouse hover leave
		events[#events + 1] = element.MouseLeave:Connect(function()
			_L.Audio.Play(
				interactSoundId,
				script,
				(enableRandomPitch and math.random(95, 105) / 100 or 1),
				interactSoundVolume
			)
		end)
	elseif interactType == "mouseclick" then
		--- Mouse click
		events[#events + 1] = element.MouseButton1Click:Connect(function()
			_L.Audio.Play(
				interactSoundId,
				script,
				(enableRandomPitch and math.random(95, 105) / 100 or 1),
				interactSoundVolume
			)
		end)
	end

	--- Return function to cancel this behavior
	return function()
		for _, event in ipairs(events) do
			event:disconnect()
		end
		events = nil
	end
end
