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

How do I get a sound to play for everyone near the person?

Asked by 6 years ago
Edited 6 years ago

Just a starting note, I've just began scripting on roblox but I have some experience in other languages so I'm kinda new but I kinda know what's going on.

I've created an evade tool, similar to the one in halo. I found a sound that I liked and I have it being played when the user clicks their mouse. However, this only works for the user and I want everyone around this person to be able to hear the noise too.

Any suggestions? Thanks.

EDIT: this is was my local script looks like:

local sound = script.Parent.Sound
local clone = sound:Clone()
...
--when they player clicks their mouse:
function onButton1Down(mouse)
...
clone.Parent = pl.HumanoidRootPart
clone:Play()

end

0
I would use magnitude. ThatPreston 354 — 6y
0
If you're using a local script, use server script instead. 522049 152 — 6y
0
Put the sound inside the humanoidrootpart of that person User#20388 0 — 6y
0
Under the sound's properties, you can adjust the MaxDistance. MaxDistance determines how far can the sound be heard (change it to 50 and the sound can be heard within 50 studs))) hellmatic 1523 — 6y
View all comments (7 more)
0
I put the sound inside the humanoidrootpart and it didn't work. Also I have it as a local script but I'm not sure if I'm able to change it to a server script sonicfan0405 18 — 6y
0
Put it inside the torso. RibgyTheRacoon 67 — 6y
0
I'm using the server test thing with 2 players and on player1's torso I can see the playing box is checked when l am on player2's server, but the sound is not playing sonicfan0405 18 — 6y
0
use the server to play it, locally it won't work User#20388 0 — 6y
0
how do i access a player's torso using a server script is what im stuck on sonicfan0405 18 — 6y
0
you can make a server script that clones the sound and in the local script it enables the server script hellmatic 1523 — 6y
0
or use remotevents hellmatic 1523 — 6y

Answer this question