Script Isn't working (simple)

So i have made a button in the game on a surface GUI that should play a sound on a block when the button is pressed, But nothing happens when i click it and this is the script i use, Please help me identify the problem:

local music = game.Workspace.Music.MusicBlock

script.Parent.MouseButton1Click:Connect(function()
music.Sound.SoundId = “17721235296”
music.Sound.Playing = true
end)

local music = game.Workspace.Music.MusicBlock

script.Parent.MouseButton1Click:Connect(function()
    music.Sound.SoundId = "rbxassetid://17721235296"
    music.Sound.Playing = true
-- or you can replace "music.Sound.Playing = true" with "music.Sound:Play()" it replays the whole song if I remember correctly.
end)

This is the right version I guess

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.