How Do I Make A Debounce For This Sound Script

function PlaySound()

script.Parent.Parent.TrainingSound:Play()

end

script.Parent.MouseButton1Click:Connect(PlaySound)

Do you only want it to only run when the audio is not playing? You can do so by using .Ended on sounds.

local sound = script.Parent.Parent.TrainingSound

local deb = false
local function playSound()
    if deb then return end
    deb = true
    sound:Play()
    sound.Ended:Wait()
    deb = false
end

script.Parent.MouseButton1Click:Connect(playSound)