|
| 17 Apr 2017 05:23 PM |
| Example: In a basketball court there is a net. Whenever someone shoots and it goes inside the net, the ball will activate the sound and will be played. The problem is I want the sound to be only played for 5 seconds. The timelength of the sound is 223 seconds. The TimePosition is set at ### ### ##### came with this script ( chaching is the sound name): function onTouched(hit) script.Parent.Chaching:play() end script.Parent.Touched:connect(onTouched) I just want the sound to stop playing after 5 seconds but it won't because the timelength is 223 seconds which means the song will still be playing for about 100+ more seconds. |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2017 05:25 PM |
Example: In a basketball court there is a net. Whenever someone shoots and it goes inside the net, the ball will activate the sound and will be played.
The problem is I want the sound to be only played for 5 seconds.
The TimeLength of the sound is 223 seconds.
The TimePosition is set at 50
The model came with this script ( chaching is the sound name):
function onTouched(hit) script.Parent.Chaching:play() end script.Parent.Touched:connect(onTouched)
I just want the sound to stop playing after 5 seconds but it won't because the timelength is 223 seconds which means the song will still be playing for about 100+ more seconds. |
|
|
| Report Abuse |
|
|
Numak
|
  |
| Joined: 12 Jan 2017 |
| Total Posts: 151 |
|
|
| 17 Apr 2017 05:27 PM |
| Good scripting but why don't you make it so when you make it you stay there for 100 seconds ;-; |
|
|
| Report Abuse |
|
|
dexperaux
|
  |
| Joined: 18 Dec 2013 |
| Total Posts: 153 |
|
|
| 17 Apr 2017 05:28 PM |
function onTouched(hit) script.Parent.Chaching:play() wait(5) script.Parent.Chaching:Stop() end script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
Xenla
|
  |
| Joined: 31 Oct 2009 |
| Total Posts: 319 |
|
|
| 17 Apr 2017 05:29 PM |
wait(5) then musicid = nil |
|
|
| Report Abuse |
|
|
vexieh
|
  |
| Joined: 22 Oct 2009 |
| Total Posts: 3468 |
|
|
| 17 Apr 2017 05:30 PM |
^ Cute beginner Sound:Play() wait(5) Sound:Stop()
|
|
|
| Report Abuse |
|
|
Xenla
|
  |
| Joined: 31 Oct 2009 |
| Total Posts: 319 |
|
|
| 17 Apr 2017 05:30 PM |
| gonna smacku i mean- hug you |
|
|
| Report Abuse |
|
|
|
| 17 Apr 2017 05:43 PM |
| Thank you, everyone who was involved with this post, the script successfully turned out how I wanted it to be. I also learned something from this. |
|
|
| Report Abuse |
|
|