This topic was modified 1 year, 8 months ago by johngrigni. Local Progress = Song.TimePosition / Song. Is there any way to get the percent played of an audio file My client wants a progress bar for audio. If Song:IsA("Sound") and Song.IsPlaying = true then Local RandomSong = SongsĪlso this should be the fixed script for the local side: local RunService = game:GetService("RunService") The reason why it’s not playing the songs is cause it’s only listening to what’s being played on the server side, you should probably just create a random song picker check so it plays a random song: local Songs = :GetChildren() AUDIO BAR PROGRESS MATH UPDATEBut I have a problem : How can I update the slider in real time during the play back of the music. = UDim2.new(Progress, 0, 1, 0)ĭid I really just put the RandomSong variable inside the RenderStepped event- Id like to add a progress bar for the music, a slider I think. Local Progress = RandomSong.TimePosition / RandomSong.TimeLength If RandomSong and RandomSong.IsPlaying = true then RunService.RenderStepped:Connect(function() Local MusicProgress = PlayerGui:WaitForChild("ProgressBar")įor _, Song in pairs(Songs:GetChildren()) do Local PlayerGui = Player:WaitForChild("PlayerGui") You should have something like this in a LocalScript inside 1 of the local descendants: local RunService = game:GetService("RunService") Use the RunService’s RenderStepped Event to detect changes every frame or so on the client
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |