Hey, I have this super simple script, but it really feels like a hard thing to do. When I touch a brick, it makes a sound, but it keeps playing over and over. Is there a way for it to just play once and then stop? Thanks!
1 | function onTouched(hit) |
2 | script.Parent.Sound:play() |
3 | wait( 2 ) |
4 | script.Parent.Sound:stop() |
5 | end |
6 |
7 | script.Parent.Touched:connect(onTouched) |
-LukeGabrieI
You need to make
1 | :play() |
capitalized, like this:
1 | :Play() |
same with
1 | :stop() |
should be
1 | :Stop() |