local function z(z,x)while not z:FindFirstChild(x)do z.ChildAdded:wait()end return z[x]end local x=script.Parent local S=z(x,"\072\097\110\100\108\101")local g=false local J function OnTouched(z)local x=z.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if g==false then g=true if x then S.Splat:Play()else S.Ting:Play()end end wait(.5)g=false end x.Equipped:connect(function()J=S.Touched:connect(OnTouched)end)x.Unequipped:connect(function()if J then J:disconnect()J=nil end end)
-- Waits for the child of the specified parent
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do
		parent.ChildAdded:wait()
	end
	return parent[childName]
end

local Tool = script.Parent
local Handle = WaitForChild(Tool, "Handle")
local Debounce = false

local TouchConnection

function OnTouched(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if Debounce == false then
		Debounce = true
		if humanoid then
			Handle.Splat:Play()
		else
			Handle.Ting:Play()
		end
	end
	wait(0.5)
	Debounce = false
end

Tool.Equipped:connect(function()
	TouchConnection = Handle.Touched:connect(OnTouched)
end)

Tool.Unequipped:connect(function()
	if TouchConnection then
		TouchConnection:disconnect()
		TouchConnection = nil
	end
end)
