I wanted the sound to play once the player torso's distance is close by the noob and stop when the player's distance is too far.
local player = game.Players.LocalPlayer
local noob = game.Workspace.NoobStand.Noob
local song = Instance.new('Sound',player.PlayerGui)
song.SoundId = 'rbxassetid://302095292'
song.Volume = 1
song.Looped = true
while wait() do
local magnitude = (noob.Torso.Position - player.Character.Torso.Position).magnitude
if magnitude < 6 then
song:Play()
print("Enter")
elseif magnitude > 6 then
print("Exit")
song:Stop()
end
end
No errors in output.

2 comments
For some reason, it still only works once.
I fixed it, I had to check if the song is playing and if it's not.