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

Music script not working?

Asked by 10 years ago

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)
0
Are you testing it in solo mode? It might not work in solo mode. SanityMan 239 — 10y
0
didn't work. Grenaderade 525 — 10y
0
What is the script.Parent? A join sound? SanityMan 239 — 10y
0
It's a sound. Grenaderade 525 — 10y
View all comments (3 more)
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). SanityMan 239 — 10y
0
Maybe ID is wrong. Vividex 162 — 10y
0
Is the Volume around 1? Shawnyg 4330 — 10y

1 answer

Log in to vote
1
Answered by 10 years ago

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!

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) Grenaderade 525 — 10y
0
It works! Thanks. Grenaderade 525 — 10y
Ad

Answer this question