Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. SoundGroup = game.Workspace.SoundsforWorld
  2. TouchedBrick = nil
  3. debounce = false
  4. SoundGroup.Overworld:Play()
  5.  
  6. local Sounds = SoundGroup:GetChildren()
  7.  
  8. for i,v in pairs (game.Workspace.SoundTouch:GetChildren()) do
  9. v.Touched:connect(function()
  10. if debounce == false then
  11. debounce = true
  12. TouchedBrick = v.Name
  13. print(v.Name)
  14. for _,u in pairs (Sounds) do
  15. if TouchedBrick ~= u.Name and u.Playing == true then
  16. repeat wait(.1) u.Volume = u.Volume - .05 until u.Volume == 0
  17. u:Stop()
  18. u.Volume = .3
  19. if TouchedBrick ~= u.Name then
  20. SoundGroup[v.Name]:Play()
  21. print(u.Name)
  22. end
  23.  
  24. break
  25. end
  26.  
  27. end
  28. wait(2)
  29. debounce = false
  30. end
  31. end)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement