Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Sound doesn't loop?

I have a brick with fire on it, and inside the brick is a sound with the sound ID preset and the looped set as true. In my script I have this line (outside a function, it should just continue playing when its in the workspace).

S = script.Parent.Sound
S:Play()

It plays once and then stops even though it's set as looped. What do I do?

Edit: This is playing in a brick and it's supposed to play until it's removed, not when someone joins. Also, it should be loud enough that most people can hear it not just someone close to it.

3 answers

Here you go bud: If you want it to run globally as in you can hear it from anywhere, place it inside of workspace with a sound inside of workspace.

If you want it locally, put the sound inside of the brick and the script inside of the brick, this will then make the sound locally and only be heard near that brick.

function onPlayerAdded() 
wait(0.1) 
script.Parent.Sound:Play() 
script.Parent.Sound.Looped = true
end

game.Players.PlayerAdded() 

Try doing it this way:

s = script.Parent

while wait(9) do -- change the Time length
s.sound:play()
end

if that doesn't work out try doing this

s = script.Parent
s.sound:play()
s.sound.Looped = true

Try this.

function onPlayerAdded()
    wait(0.1)
    while true do
    script.Parent.Sound.Play()
    wait(120)-- length of the song time
game.Players.PlayerAdded()

So the sound will play when a player is added/respawned. And put the script and the sound in WORKSPACE. Not in a part.

If you want the brick to play sound, you would need a local script, with a code that when a player gets close to the brick, it will play a sound. If you want that, just put a invisible brick next to the brick you want to play a sound, and use an onTouch function when a player touches it, a sound will play.

1 comment

0

This is playing in a brick and it's supposed to play until it's removed, not when someone joins. Also, it should be loud enough that most people can hear it not just someone close to it.

This discussion is preserved as it was. New answers, comments, and votes are closed.