SHARE
TWEET

Untitled

a guest Oct 21st, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Water1 Sound Has Started!")
  2.  
  3. game.Workspace.Water1.WaterfallSound:Play()
  4.  
  5. local function loopNTimes(sound, numberOfLoops)
  6.     if not sound.IsPlaying then
  7.         sound.Looped = true
  8.         local connection = nil
  9.         connection = sound.DidLoop:Connect(function(soundId, numOfTimesLooped)
  10.             print(numOfTimesLooped)
  11.             if numOfTimesLooped >= numberOfLoops then
  12.                 -- disconnect the connection
  13.                 connection:Disconnect()
  14.                 -- stop the sound
  15.                 sound:Stop()
  16.             end
  17.         end)
  18.         sound:Play()
  19.     end
  20. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top