hi. so if i want to repeat between second 10 and 20 until a event gets fired and then jump to second 40. how would i do that?
local repeatSound = true
local audio = pathtoaudio
function repeatAudio(sound)
if not sound.IsLoaded then sound.Loaded:Wait() end
sound.TimePosition = 10
sound:Play()
repeat
if sound.TimePosition >= 20 then
sound.TimePosition = 10
end
until not repeatSound
sound.TimePosition = 40
end
coroutine.wrap(repeatAudio)(audio)
event:Connect(function()
repeatSound = false
end)
this wont work like intended since it doesnt check when it hits second 20
i specified that i accidentally posted
so this will give me back control over the sound after done?
also what exactly is a coroutine wrap? i like wraps with meatballs
why did you use (word)(word) since when that workks?
why did you use (word)(word) since when that workks?
-
repeatAudio
is the function’s name andaudio
is the parameter (and yes it works)
coroutine.wrap(repeatAudio)(audio)
also what exactly is a coroutine wrap?
- Coroutines make you able to run multiple lines of code in a script at once
YOUR SCRIPT doesnt work!!! please fix?!
Are there any errors in the output
from what I see, it should work?
Okay okay you are right
can i also put it in commas? like parameters in functions?
i dont know what you mean by that, do you want to play the function multiple times or play multiple sounds at the same time?
bro are you there???NOTHING OF ALL THAT ACTUALLY1 reply to my direct message!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.