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

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

Asked by 2 years ago

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

Log in to vote
0
Answered by 1 year ago
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!

Ad

Answer this question