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

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

Asked by
tber8 37
8 years ago
Edited 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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.

0
what do i do if the file doesnt load??? tber8 37 — 8y
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. plasma_node 343 — 8y
1
sorry i fixed it. it wasn't in a local script tber8 37 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

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

Answer this question