local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local collectionservice = game:GetService("CollectionService")
for _,Part in pairs(collectionservice:GetTagged("Items")) do
spawn(function()
while true do
wait(.2)
if (player.Character.HumanoidRootPart.Position - Part.Position).magnitude < 10 then
print("yes")
else
print("no")
end
end
end)
end
It prints "no" and "yes" at the same time.
I know the problem is that some parts are not inside the proximity while others are. How would I fix it so you only need to be close to one part?
