How do I add a sound in a button GUI?

So I want to add a sound to a button GUI but when I put this script:

function onClicked(clicked)
	script.Parent.Sound:play()
end
script.Parent.MouseButton1Click:connect(onClicked)
-- 

it doesn’t work, did I do something wrong in this script?

script.Parent.Sound:Play()
Notice the capitalization. The “Play” must be capitalized. Same with :Connect()

1 Like

Ah thank you, I thought I did something wrong but seeing this fixed my problem!

1 Like