Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there a way to wait until a sound is a certain amount of time in?

Asked by 3 years ago
Edited 3 years ago

In my code I have a sound that plays and then it waits for 6 seconds. The problem is, the sound sometimes is delayed by like half a second and doesn't stop where I want it to. Can you point me into the right direction as to what I would use to stop the song when it is a certain amount of time in? Is there a certain function I need to use or something???

1
Sound.TimePosition DeceptiveCaster 3761 — 3y
0
I tried using repeat wait () until it was a certain amount of time in but it didn't work. Then I just assumed that I can't use it. Is there a different way I should use it? ASimpleGalaxy 36 — 3y

2 answers

Log in to vote
1
Answered by 3 years ago

There are some answers in the comments but yes you could just add a wait to the part of the song you want to stop or https://developer.roblox.com/en-us/api-reference/property/Sound/TimePosition

Ad
Log in to vote
0
Answered by 3 years ago

Wow, I figured it out. Apparently you can't just put equals 'cause it just plays through the sound anyways... You have to put >= or >...

0
I feel so stupid for asking this after figuring it out... It works perfectly now though... ASimpleGalaxy 36 — 3y

Answer this question