--[[position and movement]]
--
while wait() do
	local closestPlayer, smallestMagnitude = nil,math.huge
	for _, player in pairs(game.Players:GetPlayers()) do
		local distance = player:DistanceFromCharacter(script.Parent.HumanoidRootPart.Position)
		if distance < smallestMagnitude then
			smallestMagnitude = distance
			closestPlayer = player
			if closestPlayer and closestPlayer.Character and closestPlayer.Character:FindFirstChild("HumanoidRootPart") then
				script.Parent.BenHumanoid:MoveTo(closestPlayer.Character.HumanoidRootPart.Position)
			end
		end
	end
end
