when i try to do it with any of the scripts i foudn on dev forum, it just returns nil when getting the sound id.
Heres the code:
local Screen = script.Parent.Screen.SurfaceGui
local PP = script.Parent["Pause/Play"]
local Vol = script.Parent.Volume
local StationButton = script.Parent.Station
local Songs = game.ReplicatedStorage:WaitForChild("RadioMusic")
local Station = "Classics"
local On = false
local Music = script.Parent.Main.Song
StationButton.ClickDetector.MouseClick:Connect(function()
local MathRand = math.random(1, 5)
if MathRand == 1 then
Station = "Classics"
Music.SoundId = Songs.CurrentSong[Station].Value
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
elseif MathRand == 2 then
Station = "Intense FM"
Music.SoundId = Songs.CurrentSong[Station].Value
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
elseif MathRand == 3 then
Station = "98.1 RBLRAD"
Music.SoundId = Songs.CurrentSong[Station].Value
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
elseif MathRand == 4 then
Station = "Goofy Tunes FM"
Music.SoundId = Songs.CurrentSong[Station].Value
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
elseif MathRand == 5 then
Station = "Terminax FM"
Music.SoundId = Songs.CurrentSong[Station].Value
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
end
end)
Screen:GetPropertyChangedSignal("Enabled"):Connect(function()
if Screen.Enabled == true then
On = true
Music.SoundId = Songs.CurrentSong[Station].Value
Music.Playing = true
Screen.Frame["Station Name"].Text = Songs.CurrentSong[Station].Name
else
On = false
Music.Playing = false
end
end)
I just want to get the name of the song based on its sound id
(the IDS are stored in strings, and should not return nil. I also removed the broken code to get the songs name.)