equipped = true script.Parent.Equipped:connect(function(mouse) Looped = true tool = script.Parent Handle = tool:WaitForChild'Handle' sound = Handle:WaitForChild'Sound' tool.Activated:connect(function() sound:Play() sound.Looped = true equipped = false Parent.Unequipped:connect(function() sound.Looped = false end) end) end)
Here, this should be your solution:
local tool = script.Parent local handle = tool:FindFirstChild("Handle") local sound = handle:FindFirstChild("Sound") equipped = false script.Parent.Equipped:connect(function() equipped = true sound.Looped = true sound:Play() end) script.Parent.Unequipped:connect(function() equipped = false sound:Stop() end)