As you read from the title. You can see that I need to know Sound Scripts such as like how do I make the sound turn on/off when touch a part? This is very helpful since I’ve been experiencing a lot of problems with Sound Regions.
If you didn’t understand what I wrote, I meant Toggling On and Off the Playing Button which is found in Sounds - Properties.
If you know anything related to this please leave down a reply.
Thanks!
you just make the sound not loop so when you play it when touching the part it will play the sound and you don’t need to turn it off
you can just do script.Parent.SoundName:Play() if you want to play the sound
and if you want it to pause script.Parent.SoundName:Pause()
I’m making a rain sound effect, If I turn loop off it will turn off unexpectedly which I don’t want to happen. Is there a way where I can keep it looping but I can pause it perhaps. Just like what you said?
Thank you for your help!
make it loop already then just play the sound when player touch the part
i hope you know how to use the touch event
I do know how, Thank you for asking
Noted! Thanks I will try it out and give you my feedback!
Here is an example if you didn’t touch the part it will not play and if you touch the part the sound will play https://gyazo.com/1a088603609e5a4b5fe69a0b073d2609
you just need to do
I made the script simple
script.Parent.Touched:Connect(function(hit)
script.Parent.Sound:Play()
end)
script.Parent.TouchEnded:Connect(function(hit)
script.Parent.Sound:Stop()
end)
I’d like to add, use :Resume() if you want to resume the sound, as using :Play() will make it play from the beginning
there is pause,stop,play and resume