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

How do I check the Time Position of an Audio?

Asked by 9 years ago

So I have some music playing and i want it to loop almost perfectly. I found a place where if I make the Time Position this certain time right after the music almost done playing. I make a LOCAL SCRIPT Inside the Sound/Audio.

local OutsetIsland = script.Parent
local OITP = OutsetIsland.TimePosition

if OITP == 119 then
OITP = 13 
end

For some reason it doesn't do anything when the Audio Time Position hits 119 and there are no errors. Please help, thank you.

0
You can't change the time that the audio is at. In other words, 'TimePosition' is a value that can't be changed, such as the name of 'Workspace' User#9949 0 — 9y
0
Maybe you can replicate the same effect by replaying the sound, making it silent, and speeding it up until it reaches the point where you want to play the sound. You should then be able to change the sound settings back to default. aquathorn321 858 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I'm assuming this is the entire script.

When this code is run, it will check if the the timeposition is 119, and it will only check once. It does not wait until the timeposition is 119. Make it check every ~0.5 seconds to see if the timeposition is 119 or greater.

Additionally, on line 5, the script is setting the variable OITP to 13, not the property the variable represents.

On a side note, there is no need for those variables. You're only using each variable once or twice and aren't using them in a situation where you actually need a variable; you aren't really saving any time or effort.

Ad

Answer this question