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

How to make only 1 music play but not 2 ? at the same time

Asked by
Bulvyte 388 Moderation Voter
8 years ago

Ok so this is the script i actually got. Let's say theres Part1 Block when you want to pass and after Part2 block you want to pass them both. So when u pass the Part1 block the script below makes music play, however when u pass part2 block this is the same script below but plays different music and also stops the old one so u don't hear 2 musics at the same time can u guys help me do it ? Please i want answers dont ignore :/

local brick = script.Parent
local sound = script.Parent.Sound
debounce = false

brick.Touched:connect(function(hit)
player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player and not debounce then
debounce = true
play = sound:Clone()
play.Parent = player.PlayerGui
play:Play()
wait(5)
debounce = false
end
end)
0
What you want in the description and in the title are different things. Do you want 2 at a time or 1 at a time? laughablehaha 494 — 8y
0
When you pass the button, you get a sound in ur playergui. then theres another brick that gives u sound. When u pass it, it also GIVES you a sound into playergui. BUT theres 2 sound so it needs 2 get rid of the other one because i want those use those bricks as a biom changer music... get it ? ;-; why is so hard to explain to you guys Bulvyte 388 — 8y

1 answer

Log in to vote
0
Answered by
lsp425 0
8 years ago

In this case, where the debounce seems to not be working, you should make the script check if the sound has already been cloned to the PlayerGui.

0
Can you please add me on skype ? i will explain because its never ever possible to explain here my skype is the_herkus Bulvyte 388 — 8y
Ad

Answer this question