when a part is pushed onto a different part then a sound plays once, how can i script this?? (am a noob at scripting)
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