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

How do i make it so when a sound ends this script waits 5 seconds?

Asked by 2 years ago

local sound = game.Workspace.Sound local beats = 0 local maxLoudness = 510 local count = game.Workspace.BPM.SurfaceGui.TextLabel

game:GetService("RunService").RenderStepped:Connect(function() local loudness = sound.PlaybackLoudness if loudness > maxLoudness then beats = beats+1 end end)

local function getAverageBpm() local minutesElapsed = sound.TimePosition/60 return beats/minutesElapsed end while wait(0.001) do count.Text = getAverageBpm()

end

1 answer

Log in to vote
0
Answered by
vileras 22
2 years ago

Hm, Maybe you could use 'IsPlaying' Property.

Ad

Answer this question