Everytime that I make my character teleport away, the sound is still playing.
Also, when I try to stop the sound for myself, the sound gets deleted and no one can hear it.
Insert a script into a local script, put it in the startergui, and try something like this.
01 | local Player = game.Players.LocalPlayer |
02 | Song = game.Workspace.Sound:clone() |
03 | function Touched() |
04 | if Player.PlayerGui:FindFirstChild( "Sound" ) = = nil then |
05 | Song.Parent = Player.PlayerGui |
06 | Song.Volume = 2 |
07 | Song:Play() |
08 | Song.Looped = true --set this to true or false-- |
09 | end |
10 | end |
11 |
12 | function TouchedE() |
13 | if Player.PlayerGui:FindFirstChild( "Sound" )~ = nil then |
14 | Player.PlayerGui:FindFirstChild( "Sound" ):remove() |
15 | end |
16 | end |
17 |
18 | --Change 'Part' to the name of the brick touched. |
19 | game.Workspace.Part.Touched:connect(Touched) |
20 | game.Workspace.Part.TouchEnded:connect(TouchedE) |
Hopefully this'll work. It should if you do what It says.