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

Music script not working?

I mean, you've got to be kidding me, this script should be working.

function playerEntered(newPlayer)
	script.Parent:Play()
end

game.Players.PlayerAdded:connect(playerEntered)

7 comments

0

Are you testing it in solo mode? It might not work in solo mode.

0

didn't work.

0

What is the script.Parent? A join sound?

0

It's a sound.

0

And no errors? If there are no errors, I can tell you it is a problem with the function triggering. I don't know if it would do anything, but if you would redo the function like game.Players.PlayerAdded:connect(function(plr) script.Parent:Play() end).

0

Maybe ID is wrong.

0

Is the Volume around 1?

1 answer

✓ Accepted answer

Put this in a local script:

sound_id = 0 -- Put your sounds 'SoundId' here

S = Instance.new('Sound', game.Workspace.CurrentCamera)
S.SoundId = sound_id
S:Play()

script:remove()
  • This will need to be in there players character or in StarterGui or in StarterPack!

The sound will only play one time!

2 comments

0

I'm gonna edit that so it plays in a loop.... Because this is for a game... And I need it looped, because this game is really advanced. (Not the song part though. x3)

0

It works! Thanks.

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