I have no idea how to even fix this or even explain correctly. Can somebody help?
while task.wait()do
for i,v in ipairs(workspace.Ambience.Parts:GetChildren()) do
if (script.Parent.PrimaryPart.Position - v.Position).Magnitude <= 15 then
print('Near')
else
print('Far')
end
end
end
Could you show us what parts are in the Ambience folder and their locations in workspace as compared to primary part? If it’s checking multiple objects compared to the player, that could be the case. Also, where is this script located?
Try reducing it to one part temporarily. If that solves the issue, it means that some parts are far from the player and some parts are near, hence why the output is Far Near etc.
The reason this is happening, if because you’re going through every one of those parts, some are further away than others. The script isn’t having issues, it’s just some parts are further away from your character than others, which is why some are printing as “Far” and some are “Near”.