Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I play a sound locally?

Asked by 5 years ago

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)
0
is this script located inside a gui button? if so activated is not correct, you need to call MouseButton1Click Si_SenorTN 25 — 5y
0
script.Parent.MouseButton1Click:Connect(sendNotifi) I changed it to this and still nothing. It's located in a text button OurAuthority 5 — 5y
0
Did you try running the sound in the explorer? azahid1 0 — 5y
0
Yes the sound plays in the explorer OurAuthority 5 — 5y
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. IDKBlox 349 — 5y

Answer this question