When we pluck the string of a guitar, the music is produced due to
Vibrations of both strings and body of the gutar
Music is not only due to the string, but by the whole body of the guitar. The vibrations produced by the string are enhanced by the body of the guitar and it will vibrate too to get music. if you pluck a string which is fixed on a table, you may get sound but not the music.