Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this sound making text button only work in studio testing?

I set up this function for when you hover over a text button. The text button also has a sound in it.

function onHover(mouse)
	script.Parent.Sound1.Playing = true
	script.Parent.TextSize = 36
end

script.Parent.MouseEnter:Connect(onHover)

When I play in studio, this works. When I actually play, no sound comes. How can I fix this?

2 answers

✓ Accepted answer

Are you using this in a local script or serverscript? it should be in a local script.

Try this: (connect should be lowercase, and I prefer to use Play())

function onHover(mouse)
script.Parent.Sound1:Play();
script.Parent.TextSize = 36
end
script.Parent.MouseEnter:connect(onHover)

If it doesn't work that means there is something else going on, perhaps the sound file isn't loading.

3 comments

0

what do i do if the file doesnt load???

0

@tber8 have you tried the "fixed" version I showed you btw? Well if it isn't loading, that could be a few causes, and I really can't help you there unless you are able to give more detail to the problem. Try clicking on a sound, and pressing the test button.

1

sorry i fixed it. it wasn't in a local script

i had this problem before and basically it's because roblox is dum and removes that function or something

This discussion is preserved as it was. New answers, comments, and votes are closed.