I'm having troubles finding a solution to concatenating an object location with a math.random value in a table, so I can use the concatenated object location to check a value in it, being an ID. When the script shown below is run, it says the concatenated text as is, without actually getting the value. I am at a loss.
Workspace.Music.PickSongScript:18: attempt to concatenate field 'Radio' (a userdata value)
from :
SongID = {StorageGroup.Radio ..".G."..CurrentSongGroup[1] .. ".S" .. CurrentSong[1] .. ".ID ="}
Entire script excluding variables
CurrentSongGroup = {(math.random(1,5)),} print(CurrentSongGroup[1]) CurrentSong = {(math.random(1,10)),} print(CurrentSong[1]) wait(.1) ** Error Here**SongID = {StorageGroup.Radio ..".G."..CurrentSongGroup[1] .. ".S" .. CurrentSong[1] .. ".ID ="} SongArtist = {Storage_Location.Radio ..".G".. CurrentSongGroup[1] .. ".S" .. CurrentSong[1] .. ".Artist ="} SongName = {Storage_Location.Radio ..".G"..CurrentSongGroup[1] .. ".S" .. CurrentSong[1] .. ".Name ="} RadioID = SongID[1] wait(.1) SongLength = {Radio.TimeLength} wait(.01) MusicFolder.Current.Length.Value = SongLength[1] MusicFolder.Current.Artist.Value = SongArtist[1] MusicFolder.Current.SName.Value = SongName[1] MusicFolder.Current.ID.Value = SongID[1] print(SongName[1] .. " By " .. SongArtist[1] .. " Time Until Finish " .. SongLength[1]) wait(SongLength[1])