--Click to Open/Close Drawer--

local proximityPrompt = script.Parent.Parent.ClickBox.ProximityPrompt
local clicker = script.Parent.Parent.ClickBox


game:GetService("SoundService")

local Phone = script.Parent.PhoneSound

local isPlaying = false

proximityPrompt.Triggered:Connect(function()
	print("Phone Clicked")
	
	if not isPlaying then
		isPlaying = true
		proximityPrompt.Enabled = false
		
		print("SoundPlayed")
		local copysound = Phone:Clone()
		copysound.Parent = clicker
		copysound.Ended:Connect(function()
			isPlaying = false
			proximityPrompt.Enabled = true
			copysound:Destroy()
			print("SoundKilled")
		end)
		copysound:Play()
	end
end)
