hello I'm trying to make a button have a sound when clicked but it doesnt seem to be working for me. My script is a localscript with it being a parent to the sound.

local text = script.Parent.Parent.Notification.Text

local function sendNotifi ()
	script.Parent.Parent.Parent.Parent.Notifications.Test.Text = text
	script.sendSound:Play()
end

script.Parent.Activated:Connect(sendNotifi)

5 comments

0

is this script located inside a gui button? if so activated is not correct, you need to call MouseButton1Click

0

script.Parent.MouseButton1Click:Connect(sendNotifi) I changed it to this and still nothing. It's located in a text button

0

Did you try running the sound in the explorer?

0

Yes the sound plays in the explorer

0

Are you getting any errors? It should work if the sound is named 'sendSound' and if line 1 and line 4 aren't erroring.