Hello, beginner scripter here.. So I'm not that amazing at scripting obviously, so I need someone that is better to help me with this. I have a Script that uses a Brick (Brick keeps the sound in the area so it doesn't escape outside of it) In the Starter GUI I have 2 Sounds. One for Stop & One for Play. But I noticed whenever I jump the sound completely vanishes and I feel like the issue is could be that I made it a "Touch" script..? Hoping someone can help me!! I will post the 2 scripts inside of the block.
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')then game.Players[hit.Parent.Name].PlayerGui.Sound2:Stop() game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume=1 game.Players[hit.Parent.Name].PlayerGui.Sound1:Play() end end)
script.Parent.TouchEnded:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid')then game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume=0 end end)
The reason it's stopping when you jump is because of your second script
script.Parent.TouchEnded:connect(function(hit) -- Fires when something stops touching the part if hit.Parent:FindFirstChild('Humanoid')then game.Players[hit.Parent.Name].PlayerGui.Sound1.Volume=0 -- Turns sound1 off end end)
When you are jumping it's turning Sound1's volume to 0, essentially turning it off.
p.s. you can have both of those scripts in one script.