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

Why does this simple code not play the song?

Hey guys! I have this code for a radio. I checked all sound ID's, and tested each separately. They're correct. But with this code, the songs don't play. Why?

while wait() do
	songs = script.Parent:GetChildren()
	rando = math.random(1,#songs)
	if songs[rando].Name ~= "Script" then
		workspace["Now Playing"].Value = songs[rando].Name
		songs[rando]:Play()
	end
end

1 comment

0

Give me a link the model?

1 answer

You've put:

workspace["Now Playing"].Value = songs[rando].Name

You've missed out game., so it would be:

game.Workspace["Now Playing"].Value = songs[rando].Name

4 comments

0

I approve ^

0

iFlusters, you are allowed to say workspace without game, so your answer is wrong.

0

Both work.

0

Sorry.

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