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

How could I play a sound to a specific player when they are close to a chosen Player?

Hello Developers,

I'm having a bit of trouble with sounds today!

Can someone please help me play a sound to players who are close to the murderer in my game, who is another player?

I can't seem to get anything to work; from Scripts to LocalScripts, Sounds and RemoteEvents.

I really appreciate any help you can provide.

Anthony

1 answer

murder = murderer.Character -- not sure how u store who is the murderer
local player = game.Players.LocalPlayer.Character
local sound = YourSound
while wait() do
if murder.Magnitude - player.Magnitude < 30 then
sound:Play()
end
end


hope this helps!

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