Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SoundGroup = game.Workspace.SoundsforWorld
- TouchedBrick = nil
- debounce = false
- SoundGroup.Overworld:Play()
- local Sounds = SoundGroup:GetChildren()
- for i,v in pairs (game.Workspace.SoundTouch:GetChildren()) do
- v.Touched:connect(function()
- if debounce == false then
- debounce = true
- TouchedBrick = v.Name
- print(v.Name)
- for _,u in pairs (Sounds) do
- if TouchedBrick ~= u.Name and u.Playing == true then
- repeat wait(.1) u.Volume = u.Volume - .05 until u.Volume == 0
- u:Stop()
- u.Volume = .3
- if TouchedBrick ~= u.Name then
- SoundGroup[v.Name]:Play()
- print(u.Name)
- end
- break
- end
- end
- wait(2)
- debounce = false
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement