Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how can i make a sound play when a part touches another part?

when a part is pushed onto a different part then a sound plays once, how can i script this?? (am a noob at scripting)

1 comment

0

check the new scirpt

1 answer

✓ Accepted answer
local AnotherPart = workspace.AnotherPart
local Sound = game.Workspace.Sound

local Debounce = false

local COOLDOWN = 5

script.Parent.Touched:Connect(function(hit)
	if hit == AnotherPart and not Debounce then
		Debounce = true
		Sound:Play()
		task.wait(COOLDOWN)
		Debounce = false
	end
end)

AnotherPart will be the part where it will play the sound when touched the script.Parent brick.

Be sure to locate the AnotherPart and the Sound to where they are in the game

COOLDOWN is the cooldown value so it makes the sound playing have cooldown

Last thing is put this script inside the brick

This discussion is preserved as it was. New answers, comments, and votes are closed.