Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Water1 Sound Has Started!")
- game.Workspace.Water1.WaterfallSound:Play()
- local function loopNTimes(sound, numberOfLoops)
- if not sound.IsPlaying then
- sound.Looped = true
- local connection = nil
- connection = sound.DidLoop:Connect(function(soundId, numOfTimesLooped)
- print(numOfTimesLooped)
- if numOfTimesLooped >= numberOfLoops then
- -- disconnect the connection
- connection:Disconnect()
- -- stop the sound
- sound:Stop()
- end
- end)
- sound:Play()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement