local mat = workspace.Part local debounce = false local hitm = mat.music
mat.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Torso") and debounce == true then hitm:Play() wait(.5) hitm.Ended:Wait() debounce = false end end)
Your debounce starts off false so the code is never run since you're looking for whether the debounce is true.
local mat = workspace.Part local debounce = false local hitm = mat.music mat.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Torso") and debounce == false then debounce = true hitm:Play() wait(.5) hitm.Ended:Wait() debounce = false end end)