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

How can I get it so that a sound plays in a certain radius?

Asked by 10 years ago

How can I get it so that a sound plays in a certain radius and then gets softer as you get farther away from it. If it were in a part and I got next to it I would here the sound.

0
I think if you put it in the brick, it will play from that brick only, and then it will automatically do that. I'm not sure though. Tempestatem 884 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

http://wiki.roblox.com/index.php?title=Sounds

By using the script below, you don't have to worry about preloading.(To my knowledge, since it is created on startup, it is loaded. Please correct me if my thinking is incorrect.)

local sound = Instance.new("Sound")
sound.SoundId = "http://www.roblox.com/asset/?id=159688676" --Change the last numbers of the link to the id of your audio.
sound.Parent = script.Parent
sound:play()

If you need more help, feel free to PM me on Roblox!

I forgot to mention to put the script as a parent of a part, how silly of me!

Ad

Answer this question