✓ Accepted answer
First of all, you should capitalize the first letter of the :Play() function. But making it an exact radius of 10 studs could be made with a LocalScript in the PlayerGui. It will only affect the player and stop the audio when the player is 10 studs away from it.
Put this into the script:
for _, v in pairs(game.Players:GetChildren()) do
if v:IsA("Player") then
script.LocalScript:Clone().Parent = v.PlayerGui
end
Put this into the LocalScript:
while wait() do
while script.Parent.Parent.Character do
if (script.Parent.Character.Torso.Position - workspace.Partname.Position).magnitude <= 10 then
workspace.Partname.Sound:Play()
repeat wait() until (script.Parent.Character.Torso.Position - workspace.Partname.Position).magnitude > 10
workspace.Partname.Sound:Stop()
end
wait()
end
end
These code lines are not really good in my opinion and I could do them better, but I'm not having much time right now. Anyways, I hope you get the hang of it and can do your script.